JBoss Tools SVN: r38599 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-10 07:01:37 -0500 (Fri, 10 Feb 2012)
New Revision: 38599
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit is skipped because window size should be set.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 11:23:05 UTC (rev 38598)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 12:01:37 UTC (rev 38599)
@@ -41,7 +41,7 @@
super(name);
}
- public void testScrolling_Jbide8701() throws Throwable {
+ public void _testScrolling_Jbide8701() throws Throwable {
boolean testFinished = false;
IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME,
VpeUiTests.IMPORT_PROJECT_NAME);
@@ -83,6 +83,7 @@
int scrollY = windowInternal.getScrollY();
assertEquals("Initital visual position is wrong", 0, scrollX); //$NON-NLS-1$
assertEquals("Initital visual position is wrong", 0, scrollY); //$NON-NLS-1$
+
sourceEditor.setFocus();
for (int i = 0; i < 15; i++) {
pressKeyCode(PlatformUI.getWorkbench().getDisplay(), SWT.PAGE_DOWN);
14 years, 2 months
JBoss Tools SVN: r38598 - trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 06:23:05 -0500 (Fri, 10 Feb 2012)
New Revision: 38598
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
Log:
JBIDE-10785 : refresh parent to prevent o.o.s.p.BackingStoreException: Resource '/parent/web/.settings' does not exist.
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-02-10 11:15:37 UTC (rev 38597)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-02-10 11:23:05 UTC (rev 38598)
@@ -56,6 +56,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.maven.core.IJBossMavenConstants;
+import org.jboss.tools.maven.core.MavenUtil;
import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.jsf.MavenJSFActivator;
import org.jboss.tools.maven.seam.MavenSeamActivator;
@@ -163,6 +164,12 @@
}
if ("war".equals(packaging)) { //$NON-NLS-1$
IDataModel model = createSeamDataModel(deploying, seamVersion, project);
+ //JBIDE-10785 : refresh parent to prevent
+ // org.osgi.service.prefs.BackingStoreException: Resource '/parent/web/.settings' does not exist.
+ if (!fproj.hasProjectFacet(jsfFacet)) {
+ MavenUtil.refreshParent(mavenProject);
+ }
+
installWarFacets(fproj, model, seamVersion, monitor);
} else if ("ear".equals(packaging)) { //$NON-NLS-1$
installEarFacets(fproj, monitor);
14 years, 2 months
JBoss Tools SVN: r38597 - trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 06:15:37 -0500 (Fri, 10 Feb 2012)
New Revision: 38597
Modified:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java
Log:
JBIDE-10750 : disable test failing randomly
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java 2012-02-10 11:09:23 UTC (rev 38596)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java 2012-02-10 11:15:37 UTC (rev 38597)
@@ -50,6 +50,7 @@
assertTrue("Java Facet is missing", facetedProject.hasProjectFacet(JavaFacet.FACET));
}
+ /*
@Test
public void testMultiModule() throws Exception {
IProject[] projects = importProjects("projects/jpa/multi",
@@ -78,4 +79,5 @@
assertIsJpaProject(ejb, JpaFacet.VERSION_2_0);
}
+ */
}
14 years, 2 months
JBoss Tools SVN: r38596 - in trunk/vpe: tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-10 06:09:23 -0500 (Fri, 10 Feb 2012)
New Revision: 38596
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/facets.jsp
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8701 - junit was added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2012-02-10 11:05:27 UTC (rev 38595)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2012-02-10 11:09:23 UTC (rev 38596)
@@ -159,6 +159,7 @@
* source selection to visual selection).
*/
final public void refreshVisualSelection() {
+ setUpdateSelectionEventFlag(true);
refreshVisualNodeSelection();
refreshVisualTextSelection();
}
@@ -203,7 +204,6 @@
* Selects text in the Visual Part Visual Part according to source selection.
*/
private void refreshVisualTextSelection() {
- setUpdateSelectionEventFlag(true);
// checks for null, for case when we close editor and background
// update job is running
if (getSourceEditor().getTextViewer() == null) {
@@ -239,7 +239,6 @@
restoreVisualCursorPosition(elementMapping.getTemplate(), nodeData, range);
}
}
- setUpdateSelectionEventFlag(false);
}
/**
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/facets.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/facets.jsp (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/facets.jsp 2012-02-10 11:09:23 UTC (rev 38596)
@@ -0,0 +1,1316 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+
+<html>
+<head>
+<title></title>
+<link href="/css/main.css" rel="stylesheet" type="text/css" />
+<style type="text/css">
+h1 {
+ background-color: white;
+}
+
+.label {
+ font-weight: bold;
+}
+
+.whiteLine {
+ background-color: white;
+ border: 1px solid black;
+}
+
+.panel {
+ background-color: SteelBlue;
+ border: 1px solid black;
+ vertical-align: top;
+}
+
+.goldPanel {
+ background-color: gold;
+ border: 1px solid black;
+}
+
+.greenPanel {
+ background-color: forestGreen;
+ border: 1px solid black;
+}
+
+.indianRedPanel {
+ background-color: IndianRed;
+ border: 1px solid black;
+}
+
+.thistlePanel {
+ background-color: thistle;
+ border: 1px solid black;
+}
+
+.orangePanel {
+ background-color: orange;
+ border: 1px solid black;
+}
+
+.darkBluePanel {
+ background-color: DarkSlateBlue;
+ border: 1px solid black;
+}
+
+.darkVioletPanel {
+ background-color: DarkViolet;
+ border: 1px solid black;
+}
+</style>
+</head>
+<body>
+<f:view>
+ <h1>1) h:panelGrid</h1>
+
+ <h:panelGrid columns="2" styleClass="panel">
+ <h:panelGrid columns="2" border="5" width="150" rules="all"
+ frame="above" cellpadding="4" cellspacing="6" bgcolor="silver"
+ style="COLOR: #ff0080; BACKGROUND-COLOR: #ffff00; TEXT-DECORATION: underline; FONT-STYLE: italic; FONT-WEIGHT: bold; FONT-SIZE: medium; FONT-FAMILY: 'Arial Black';"
+ styleClass="goldPanel" captionClass="myStyle0" columnClasses=""
+ rowClasses="" headerClass="" footerClass="">
+ <f:facet name="footer">
+ <h:commandButton value="CB">CB</h:commandButton>
+ <p>part 111</p>
+ <p>part 222</p>
+ <input type="button" value="Input Button">Input Button</input>
+ Just Text
+ </f:facet>
+ <h:outputText value="begin" />
+
+ </h:panelGrid>
+ <h:panelGrid columns="2" border="5" width="150" rules="all"
+ frame="above" cellpadding="4" cellspacing="6" bgcolor="silver"
+ style="COLOR: #ff0080; BACKGROUND-COLOR: green; TEXT-DECORATION: underline; FONT-STYLE: italic; FONT-WEIGHT: bold; FONT-SIZE: small; FONT-FAMILY: 'Arial Black';"
+ styleClass="greenPanel" captionClass="myStyle0" columnClasses=""
+ rowClasses="" headerClass="" footerClass="">
+ <f:facet name="footer">
+ <p>part 111</p>
+ <p>part 222</p>
+ <input type="button" value="Input Button">Input Button</input>
+ Just Text
+ </f:facet>
+ <h:outputText value="begin" />
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <h1>2) h:dataTable</h1>
+
+<h:dataTable border="1">
+ <f:facet name="header">
+<h:outputText value="AAAAAAA" />
+HHHHHHH1111Text111111
+<h:outputText value="BBBBBBBBBBBBBBB" />
+HHHHHHH222Text2222222
+</f:facet>
+</h:dataTable>
+
+ <h:panelGrid columns="4" border="1" styleClass="panel">
+ <h:panelGroup>
+ <h:outputText styleClass="whiteLine"> Correct table </h:outputText>
+ <h:dataTable value="#{user.list}" var="item" styleClass="goldPanel">
+ <f:facet name="header">
+ <h:outputText>Header</h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Footer</h:outputText>
+ </f:facet>
+ <f:facet name="caption">
+ <h:outputText>Caption</h:outputText>
+ </f:facet>
+ <h:column>
+ <h:outputText>Column 1</h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText styleClass="whiteLine">
+ Plain HTML in facets with JSF tags
+ <p></p>
+ And plus the second jsf components in facets
+ </h:outputText>
+ <h:dataTable value="#{user.list}" var="item" border="1"
+ styleClass="greenPanel">
+ <f:facet name="header">
+ <h:outputText>Header</h:outputText>
+ <h:outputText>Header2</h:outputText>
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Footer</h:outputText>
+ <h:outputText>Footer2</h:outputText>
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <f:facet name="caption">
+ <h:outputText>Caption</h:outputText>
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ </h:dataTable>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText styleClass="whiteLine"> Only plain HTML in Caption </h:outputText>
+ <h:dataTable value="#{user.list}" var="item" border="1"
+ styleClass="indianRedPanel">
+ <f:facet name="header">
+ <h:outputText>Header1</h:outputText>
+ <h:outputText>Header2</h:outputText>
+ <h:outputText>Header3</h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Footer1</h:outputText>
+ <h:outputText>Footer2</h:outputText>
+ <h:outputText>Footer3</h:outputText>
+ </f:facet>
+ <f:facet name="caption">
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <h:column>
+ <h:outputText>Column 1</h:outputText>
+ </h:column>
+ <h:column>
+ <h:outputText>Column 2</h:outputText>
+ </h:column>
+ <h:column>
+ <h:outputText>Column 3</h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:panelGroup>
+
+ <h:panelGroup>
+ <h:outputText styleClass="whiteLine"> Only plain HTML in facets and columns </h:outputText>
+ <h:dataTable value="#{user.list}" var="item"
+ styleClass="thistlePanel">
+ <f:facet name="header">
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <f:facet name="footer">
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <f:facet name="caption">
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <h:column>
+ <h:outputText>Column 1</h:outputText>
+ </h:column>
+ <h:column>
+ <h:outputText>Column 2</h:outputText>
+ </h:column>
+ <h:column>
+ <h:outputText>Column 3</h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:panelGroup>
+
+ </h:panelGrid>
+
+ <h1>3) h:column</h1>
+ <h:outputText> Correct table </h:outputText>
+ <h:dataTable value="#{user.list}" var="item" styleClass="panel"
+ columnClasses="goldPanel">
+ <f:facet name="header">
+ <h:outputText>Table Header</h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Table Footer</h:outputText>
+ </f:facet>
+ <f:facet name="caption">
+ <h:outputText styleClass="whiteLine">Table Caption</h:outputText>
+ </f:facet>
+ <h:column footerClass="greenPanel" headerClass="greenPanel">
+ <f:facet name="header">
+ <h:outputText>Col 1 header1</h:outputText>
+ <h:outputText>Col 1 header2</h:outputText>
+ <h:outputText>Col 1 header3</h:outputText>
+ <span>COL1HEAD</span> C1HText
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 1 footer1</h:outputText>
+ <h:outputText>Col 1 footer2</h:outputText>
+ <h:outputText>Col 1 footer3</h:outputText>
+ <span>COL1FOOT</span> C1FText
+ </f:facet>
+ <h:outputText>[Column 1] </h:outputText>
+ <h:outputText value="#{item}" />
+ </h:column>
+ <h:column footerClass="indianRedPanel" headerClass="indianRedPanel">
+ <f:facet name="header">
+ <span>COL2HEAD</span> C2FHead
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL2FOOT</span> C2FText
+ </f:facet>
+ <h:outputText>[Column 2] </h:outputText>
+ <h:outputText value="#{item}" />
+ </h:column>
+ <h:column footerClass="thistlePanel" headerClass="thistlePanel">
+ <f:facet name="header">
+ <f:facet name="header">
+ <span>COL3HEAD</span> C3FHead
+ </f:facet>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 3 footer</h:outputText>
+ </f:facet>
+ <h:outputText>[Column 3] </h:outputText>
+ <h:outputText value="#{item}" />
+ </h:column>
+ </h:dataTable>
+
+ <h1>4) rich:panel</h1>
+ <rich:panel>
+ <f:facet name="header">
+ PHead111
+ <h:outputText>PanelHeader1</h:outputText>
+ <h:outputText>PanelHeader2</h:outputText>
+ <h:outputText>PanelHeader3</h:outputText>
+ <span>P1Head</span> PHead
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 1 footer3</h:outputText>
+ <span>COL1FOOT</span> C1FText
+ FooterFacet
+ </f:facet>
+ Panel Content
+ </rich:panel>
+
+ <h1>5) rich:simpleTogglePanel</h1>
+ <rich:simpleTogglePanel id="simpleTogglePanel" switchType="client"
+ label="STP LABEL">
+ <f:facet name="header">
+ STPHead111
+ <h:outputText>STPHeader1</h:outputText>
+ <h:outputText>STPHeader2</h:outputText>
+ <h:outputText>STPHeader3</h:outputText>
+ <span>STP1Head</span> STPHead
+ </f:facet>
+ <f:facet name="footer">
+ STPFoot111
+ <h:outputText>STPFooter1</h:outputText>
+ <h:outputText>STPFooter2</h:outputText>
+ <h:outputText>STPFooter3</h:outputText>
+ <span>STP1Foot</span> STPFoot
+ </f:facet>
+ [rich:simpleTogglePanel CONTENT]
+ </rich:simpleTogglePanel>
+
+ <h1>6) rich:togglePanel</h1>
+ <rich:togglePanel switchType="client" stateOrder="closed,tip1,tip2">
+ <f:facet name="closed">
+ <h:outputText value="Closed" />
+ <rich:toggleControl>
+ <rich:toggleControl switchToState="tip1" value="#{user.next}" />
+ </rich:toggleControl>
+ </f:facet>
+ <f:facet name="tip1">
+ <h:outputText value="TIP 1" />
+ <h:panelGrid columns="2">
+ <rich:toggleControl switchToState="closed" value="#{user.close}" />
+ <rich:toggleControl switchToState="tip2" value="#{user.next}" />
+ </h:panelGrid>
+ </f:facet>
+ <f:facet name="tip2">
+ <h:outputText value="TIP 2" />
+ <h:panelGrid columns="2">
+ <rich:toggleControl switchToState="closed" value="#{user.close}" />
+ <rich:toggleControl switchToState="tip1" value="#{user.previous}" />
+ </h:panelGrid>
+ </f:facet>
+ </rich:togglePanel>
+ <rich:togglePanel switchType="client" stateOrder="tip2,tip1,closed">
+ <f:facet name="closed">
+ STPFoot111
+ <h:outputText>STPFooter1</h:outputText>
+ <h:outputText>STPFooter2</h:outputText>
+ <h:outputText>STPFooter3</h:outputText>
+ <span>STP1Foot</span> STPFoot
+ <h:outputText value="CLOSE" />
+ </f:facet>
+ <f:facet name="tip1">
+ <h:panelGroup>
+ <h:outputText value="TIPPPP111" />
+ <rich:toggleControl switchToState="tip2" value="#{user.next}" />
+ <h:outputText value="TIPPPP111" />
+ </h:panelGroup>
+ <h:outputText value="TIPPP222222" />
+ </f:facet>
+ <f:facet name="tip2">
+ <h:outputText value="TIP 2" />
+ </f:facet>
+ </rich:togglePanel>
+
+ <h1>7) tabPanel</h1>
+ <h:panelGrid columns="3">
+
+ <rich:tabPanel switchType="ajax">
+ <rich:tab label="First">
+ Here is tab #1
+ </rich:tab>
+ <rich:tab label="Second" disabled="true">
+ Here is tab #2
+ </rich:tab>
+ <rich:tab label="Third">
+ Here is tab #3
+ </rich:tab>
+ </rich:tabPanel>
+
+ <rich:tabPanel switchType="ajax">
+ <rich:tab label="First">
+ <f:facet name="label">
+ Tab Label 1
+ <h:outputText>Tab Label 111</h:outputText>
+ <h:outputText>Tab Label 222</h:outputText>
+ <h:outputText>Tab Label 333</h:outputText>
+ <span>TabLabelSpan1 </span> TabLabelSpan2
+ </f:facet>
+ Here is tab #1
+ </rich:tab>
+ <rich:tab disabled="true">
+ <f:facet name="label">
+ Tab Label 2
+ <h:outputText>Tab Label 2-111</h:outputText>
+ <h:outputText>Tab Label 2-222</h:outputText>
+ <h:outputText>Tab Label 2-333</h:outputText>
+ <span>TabLabelSpan2-1 </span> TabLabelSpan2-2
+ </f:facet>
+ Here is tab #2
+ </rich:tab>
+ <rich:tab label="Third">
+ Here is tab #3
+ </rich:tab>
+ </rich:tabPanel>
+ </h:panelGrid>
+
+ <br></br>
+ <h1>8) rich:dataTable</h1>
+ <br></br>
+
+ <h:panelGrid styleClass="panel" columns="3">
+
+ <rich:dataTable var="row" value="#{user.list}" rowKeyVar="rowKey"
+ rowClasses="goldPanel panel" columns="2">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="FIELDS" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="field1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field3" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+ </rich:columnGroup>
+
+ <f:facet name="footer">
+
+ <rich:columnGroup>
+ <rich:column></rich:column>
+ <rich:column>
+ <h:outputText value="footer1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer3" />
+ </rich:column>
+
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <rich:dataTable var="row" value="#{user.list}" rowKeyVar="rowKey"
+ rowClasses="goldPanel panel">
+ <f:facet name="caption">
+ TableCaptionText
+ <h:outputText>Caption 1</h:outputText>
+ <h:outputText>Caption 2</h:outputText>
+ <h:outputText>Caption 3</h:outputText>
+ <span>TableCaption1</span> TableCaption2
+ </f:facet>
+ <f:facet name="header">
+ Table1HText2
+ <h:outputText>Table header1</h:outputText>
+ <h:outputText>Table header2</h:outputText>
+ <h:outputText>Table header3</h:outputText>
+ <span>Table1HEAD</span> Table1HText2
+ </f:facet>
+ <f:facet name="footer">
+ TableC1FText2
+ <h:outputText>Table FOOTER1</h:outputText>
+ <h:outputText>Table FOOTER2</h:outputText>
+ <h:outputText>Table FOOTER3</h:outputText>
+ <span>Table1FOOT</span> Table1FText2
+ </f:facet>
+
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:dataTable>
+ </h:panelGrid>
+
+ <br></br>
+ <h1>9) rich:column</h1>
+
+ <h:panelGrid styleClass="panel" columns="3">
+
+ <rich:dataTable var="row" value="#{user.list}" rowKeyVar="rowKey"
+ rowClasses="greenPanel">
+ <f:facet name="header">
+ Table1HText2
+ <h:outputText>Table header1</h:outputText>
+ <h:outputText>Table header2</h:outputText>
+ <h:outputText>Table header3</h:outputText>
+ <span>Table1HEAD</span> Table1HText2
+ </f:facet>
+ <f:facet name="footer">
+ TableC1FText2
+ <h:outputText>Table FOOTER1</h:outputText>
+ <h:outputText>Table FOOTER2</h:outputText>
+ <h:outputText>Table FOOTER3</h:outputText>
+ <span>Table1FOOT</span> Table1FText2
+ </f:facet>
+
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText>Col 1 header1</h:outputText>
+ <h:outputText>Col 1 header2</h:outputText>
+ <h:outputText>Col 1 header3</h:outputText>
+ <span>COL1HEAD</span> C1HText
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 1 footer1</h:outputText>
+ <h:outputText>Col 1 footer2</h:outputText>
+ <h:outputText>Col 1 footer3</h:outputText>
+ <span>COL1FOOT</span> C1FText
+ </f:facet>
+ <h:outputText value="[column 1] #{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <span>COL2HEAD</span> C2FHead
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL2FOOT</span> C2FText
+ </f:facet>
+ <h:outputText value="[column 2] #{row}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <span>COL3HEAD</span> C3Head
+ <h:outputText value="[header 3]" />
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL3FOOT</span> C3Foot
+ <h:outputText value="[footer 3]" />
+ </f:facet>
+ <h:outputText value="[column 3] #{row}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:dataTable>
+ </h:panelGrid>
+
+ <h1>10) rich:subTable</h1>
+ <h:panelGrid columns="3" styleClass="panel">
+ <rich:dataTable value="#{user.users}" var="users" border="1">
+ <rich:column colspan="3" styleClass="orangePanel">
+ <h:outputText value="#{users.name} #{users.lastName}" />
+ </rich:column>
+
+ <rich:subTable value="#{users.list}" var="book1"
+ rowClasses="goldPanel, greenPanel">
+ <rich:column>
+ <h:outputText value="#{book1}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book1}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book1}" />
+ </rich:column>
+ </rich:subTable>
+
+ <rich:subTable value="#{user.list}" var="book2"
+ columnClasses="indianRedPanel, thistlePanel">
+ <rich:column rowspan="2">
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column rowspan="2">
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book2}" />
+ </rich:column>
+ </rich:subTable>
+ </rich:dataTable>
+
+ <rich:dataTable value="#{user.users}" var="users" border="1">
+ <rich:column colspan="3" styleClass="orangePanel">
+ <h:outputText value="#{users.name} #{users.lastName}" />
+ </rich:column>
+
+ <rich:subTable value="#{users.list}" var="book3"
+ rowClasses="goldPanel, greenPanel" headerClass="darkVioletPanel"
+ footerClass="darkBluePanel">
+
+ <f:facet name="caption">
+ TableCaptionText
+ <h:outputText>Caption 1</h:outputText>
+ <h:outputText>Caption 2</h:outputText>
+ <h:outputText>Caption 3</h:outputText>
+ <span>TableCaption1</span> TableCaption2
+ </f:facet>
+ <f:facet name="header">
+ Table1HText2
+ <h:outputText>Table header1</h:outputText>
+ <h:outputText>Table header2</h:outputText>
+ <h:outputText>Table header3</h:outputText>
+ <span>Table1HEAD</span> Table1HText2
+ </f:facet>
+ <f:facet name="footer">
+ TableC1FText2
+ <h:outputText>Table FOOTER1</h:outputText>
+ <h:outputText>Table FOOTER2</h:outputText>
+ <h:outputText>Table FOOTER3</h:outputText>
+ <span>Table1FOOT</span> Table1FText2
+ </f:facet>
+
+ <rich:column>
+ <h:outputText value="#{book3}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book3}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book3}" />
+ </rich:column>
+ </rich:subTable>
+
+ <rich:subTable value="#{user.list}" var="book4"
+ columnClasses="indianRedPanel, thistlePanel"
+ headerClass="darkVioletPanel" footerClass="darkBluePanel">
+
+ <f:facet name="caption">
+ TableCaptionText
+ <h:outputText>Caption 1</h:outputText>
+ <h:outputText>Caption 2</h:outputText>
+ <h:outputText>Caption 3</h:outputText>
+ <span>TableCaption1</span> TableCaption2
+ </f:facet>
+ <f:facet name="header">
+ Table1HText2
+ <h:outputText>Table header1</h:outputText>
+ <h:outputText>Table header2</h:outputText>
+ <h:outputText>Table header3</h:outputText>
+ <span>Table1HEAD</span> Table1HText2
+ </f:facet>
+ <f:facet name="footer">
+ TableC1FText2
+ <h:outputText>Table FOOTER1</h:outputText>
+ <h:outputText>Table FOOTER2</h:outputText>
+ <h:outputText>Table FOOTER3</h:outputText>
+ <span>Table1FOOT</span> Table1FText2
+ </f:facet>
+
+ <rich:column rowspan="2">
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column rowspan="2">
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book4}" />
+ </rich:column>
+ </rich:subTable>
+ </rich:dataTable>
+
+ <rich:dataTable value="#{user.users}" var="users" border="1">
+ <rich:column colspan="4" styleClass="orangePanel">
+ <h:outputText value="#{users.name} #{users.lastName}" />
+ </rich:column>
+
+ <rich:subTable value="#{users.list}" var="book5"
+ rowClasses="goldPanel, greenPanel">
+ <rich:column headerClass="darkVioletPanel"
+ footerClass="darkBluePanel">
+ <f:facet name="header">
+ <h:outputText>Col 111111111 header1</h:outputText>
+ <h:outputText>Col 111111111 header2</h:outputText>
+ <h:outputText>Col 111111111 header3</h:outputText>
+ <span>COL1111111111HEAD</span> C1111111111HText
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 1111111111 footer1</h:outputText>
+ <h:outputText>Col 1111111111 footer2</h:outputText>
+ <h:outputText>Col 1111111111 footer3</h:outputText>
+ <span>COL1111111111FOOT</span> C1111111111FText
+ </f:facet>
+ <h:outputText value="#{book5}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true"
+ headerClass="darkVioletPanel" footerClass="darkBluePanel">
+ <f:facet name="header">
+ <span>COL2HEAD</span> C2FHead
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL2FOOT</span> C2FText
+ </f:facet>
+
+ <h:outputText value="#{book5}" />
+ </rich:column>
+ <rich:column headerClass="darkVioletPanel"
+ footerClass="darkBluePanel">
+ <f:facet name="header">
+ <span>COL3HEAD</span> C3Head
+ <h:outputText value="[header 3]" />
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL3FOOT</span> C3Foot
+ <h:outputText value="[footer 3]" />
+ </f:facet>
+ <h:outputText value="#{book5}" />
+ </rich:column>
+ </rich:subTable>
+
+ <rich:subTable value="#{user.list}" var="book6"
+ columnClasses="indianRedPanel, thistlePanel" headerClass="goldPanel"
+ footerClass="thistlePanel">
+ <rich:column rowspan="2" headerClass="darkVioletPanel"
+ footerClass="darkBluePanel">
+ <f:facet name="header">
+ <h:outputText>Col 12222222 header1</h:outputText>
+ <h:outputText>Col 12222222 header2</h:outputText>
+ <h:outputText>Col 12222222 header3</h:outputText>
+ <span>COL12222222HEAD</span> C12222222HText
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText>Col 12222222 footer1</h:outputText>
+ <h:outputText>Col 12222222 footer2</h:outputText>
+ <h:outputText>Col 12222222 footer3</h:outputText>
+ <span>COL12222222FOOT</span> C12222222FText
+ </f:facet>
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <span>COL22222222HEAD</span> C22222222FHead
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL22222222FOOT</span> C22222222FText
+ </f:facet>
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <span>COL32222222HEAD</span> C32222222Head
+ <h:outputText value="[header 3]2222222" />
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL32222222FOOT</span> C32222222Foot
+ <h:outputText value="[footer 3]" />
+ </f:facet>
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column rowspan="2">
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book6}" />
+ </rich:column>
+ </rich:subTable>
+ </rich:dataTable>
+ </h:panelGrid>
+
+ <h1>11) rich:extendedDataTable</h1>
+ <h:panelGrid columns="3" styleClass="panel">
+ <rich:extendedDataTable value="#{user.list}" var="item1" width="200px"
+ height="200px">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText>Header</h:outputText>
+ </f:facet>
+ <h:outputText value="#{item1}" />
+ </rich:column>
+ </rich:extendedDataTable>
+
+ <rich:extendedDataTable value="#{user.list}" var="item" width="500px"
+ height="200px">
+ <rich:column sortable="false">
+ <f:facet name="header">
+ <h:outputText value="Flag" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Footer1" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column sortable="true">
+ <f:facet name="header">
+ <h:outputText value="State Name" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Footer2" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="State Capital" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Footer3" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column sortable="false">
+ <f:facet name="header">
+ <h:outputText value="Time Zone" />
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Footer4" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ </rich:extendedDataTable>
+
+ <rich:extendedDataTable value="#{user.list}" var="item" width="600px"
+ height="200px">
+ <rich:column sortable="false">
+ <f:facet name="header">
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column sortable="true">
+ <f:facet name="header">
+ <span>COL2HEAD</span> C2FHead
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL2FOOT</span> C2FText
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="State Capital" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ <rich:column sortable="false" width="300px">
+ <f:facet name="header">
+ <h:outputText value="Time Zone" />
+ <span>COL3HEAD</span> C3Head
+ <h:outputText value="[header 3]" />
+ </f:facet>
+ <f:facet name="footer">
+ <span>COL3FOOT</span> C3Foot
+ <h:outputText value="[footer 3]" />
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:column>
+ </rich:extendedDataTable>
+ </h:panelGrid>
+
+ <h1>12) rich:dataGrid</h1>
+
+ <h:panelGrid columns="2" styleClass="panel">
+ <rich:dataGrid value="#{user.list}" var="item" columns="2"
+ elements="4">
+ <f:facet name="caption">
+ <h:outputText value="Caption #{item}"></h:outputText>
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Header #{item}"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:dataGrid>
+
+ <rich:dataGrid value="#{user.list}" var="item" columns="3"
+ elements="3">
+ <f:facet name="caption">
+ <p>Part 111</p>
+ Some HTML text
+ </f:facet>
+ <f:facet name="header">
+ <span>HEAD</span>
+ <h:outputText value="#{item}"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:dataGrid>
+
+ <rich:dataGrid value="#{user.list}" var="item" columns="2"
+ elements="6">
+ <f:facet name="header">
+ HEAD
+ <h:outputText value="#{item}"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:dataGrid>
+
+ <rich:dataGrid value="#{user.list}" var="item" columns="2"
+ elements="3">
+ <f:facet name="caption">
+ CText1
+ <h:outputText value="C1" />
+ <h:outputText value="C2" />
+ <h:outputText value="C3" />
+ <span>CapS1</span> CapT1
+ </f:facet>
+ <f:facet name="header">
+ W1
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="footer">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+ <h:outputText value="#{item}" />
+ </rich:dataGrid>
+ <rich:dataGrid value="#{user.list}" var="item" columns="2"
+ elements="4">
+ <h:outputText value="#{item}" />
+ </rich:dataGrid>
+ </h:panelGrid>
+
+ <h1>13) rich:dataDefinitionList</h1>
+
+ <h:panelGrid columns="3" styleClass="panel">
+
+ <rich:dataDefinitionList var="car" value="#{user.list}" rows="3"
+ first="2" title="Cars" styleClass="greenPanel">
+ <f:facet name="term">
+ <h:outputText value="#{car}"></h:outputText>
+ </f:facet>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car}" />
+ <br />
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car}" />
+ <br />
+ </rich:dataDefinitionList>
+
+ <rich:dataDefinitionList var="car" value="#{user.list}" rows="3"
+ first="2" title="Cars" styleClass="greenPanel">
+ <f:facet name="term">
+ <h:outputText value="[term]"></h:outputText>
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="[header]"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="[footer]"></h:outputText>
+ </f:facet>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car}" />
+ <br />
+ </rich:dataDefinitionList>
+
+ <rich:dataDefinitionList var="car" value="#{user.list}" rows="3"
+ first="2" title="Cars" styleClass="greenPanel">
+ <f:facet name="caption">
+ CText1
+ <h:outputText value="C1" />
+ <h:outputText value="C2" />
+ <h:outputText value="C3" />
+ <span>CapS1</span> CapT1
+ </f:facet>
+ <f:facet name="header">
+ W1
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="term">
+ Term1
+ <h:outputText value="T1" />
+ <h:outputText value="T2" />
+ <h:outputText value="T3" />
+ <span>TS1</span> TT1
+ </f:facet>
+ <f:facet name="myfacet">
+ MYF1
+ <h:outputText value="MYF-OUT-1" />
+ <h:outputText value="MYF-OUT-2" />
+ <h:outputText value="MYF-OUT-3" />
+ <span>MYF-S1</span> MYF-T1
+ </f:facet>
+ <f:facet name="footer">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car}" />
+ myt1
+ <h:outputText value="myt1" />
+ <h:outputText value="myt2" />
+ <h:outputText value="myt3" />
+ <span>myt-S1</span> myt-T1
+ <br />
+ </rich:dataDefinitionList>
+ </h:panelGrid>
+
+ <h1>14) rich:inplaceInput</h1>
+ <h:panelGrid columns="3" styleClass="panel">
+ <rich:inplaceInput value="#{user.name}" showControls="true" />
+ <rich:inplaceInput value="#{user.name}" showControls="true">
+ <f:facet name="controls">
+ <h:panelGroup>
+ <h:commandButton value="Save" type="button" />
+ <h:commandButton value="Close" type="button" />
+ </h:panelGroup>
+ </f:facet>
+ </rich:inplaceInput>
+
+ <rich:inplaceInput value="#{user.name}" showControls="true">
+ <f:facet name="controls">
+ <h:commandButton value="Save" type="button" />
+ <h:commandButton value="Close" type="button" />
+ </f:facet>
+ </rich:inplaceInput>
+
+ <rich:inplaceInput value="#{user.name}" showControls="true">
+ <f:facet name="controls">
+ <h:commandButton value="Save" type="button" />
+ <h:commandButton value="Close" type="button" />
+ </f:facet>
+ myt1
+ <h:outputText value="myt1" />
+ <h:outputText value="myt2" />
+ <h:outputText value="myt3" />
+ <span>myt-S1</span> myt-T1
+ <br />
+ </rich:inplaceInput>
+
+ <rich:inplaceInput value="#{user.name}" showControls="true">
+ <f:facet name="controls">
+ <h:commandButton value="Save" type="button" />
+ <h:commandButton value="Close" type="button" />
+ </f:facet>
+ <f:facet name="header">
+ W1
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="term">
+ Term1
+ <h:outputText value="T1" />
+ <h:outputText value="T2" />
+ <h:outputText value="T3" />
+ <span>TS1</span> TT1
+ </f:facet>
+ myt1
+ <h:outputText value="myt1" />
+ <h:outputText value="myt2" />
+ <h:outputText value="myt3" />
+ <span>myt-S1</span> myt-T1
+ <br />
+ </rich:inplaceInput>
+
+ <rich:inplaceInput value="#{user.name}" showControls="true">
+ <f:facet name="controls">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+ </rich:inplaceInput>
+
+ </h:panelGrid>
+
+<h1> 15) rich:orderingList </h1>
+
+<h:panelGrid columns="3" styleClass="panel">
+
+<rich:orderingList value="#{user.list}" var="item" listHeight="300" listWidth="350">
+ <f:facet name="caption">
+ <h:outputText value="List Caption" />
+ </f:facet>
+ <rich:column width="180">
+ <f:facet name="header">
+ <h:outputText value="Song Name" />
+ </f:facet>
+ <h:outputText value="[You must be evil] #{item}"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Artist Name" />
+ </f:facet>
+ <h:outputText value="[Chris Rea] #{item}"></h:outputText>
+ </rich:column>
+ </rich:orderingList>
+
+ <rich:orderingList value="#{user.list}" var="item" controlsHorizontalAlign="left">
+ <f:facet name="heder">
+ CCCW1
+ <h:outputText value="CCCF1" />
+ <h:outputText value="CCCF2" />
+ <h:outputText value="CCCF3" />
+ <span>CCCS1</span> CCCT1
+ </f:facet>
+ <f:facet name="caption">
+ CCCW1
+ <h:outputText value="CCCF1" />
+ <h:outputText value="CCCF2" />
+ <h:outputText value="CCCF3" />
+ <span>CCCS1</span> CCCT1
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">
+ W1
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ <h:outputText value="Song Name" />
+ </f:facet>
+ <h:outputText value="[You must be evil] #{item}"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="footer">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ <h:outputText value="Artist Name" />
+ </f:facet>
+ <h:outputText value="[Chris Rea] #{item}"></h:outputText>
+ </rich:column>
+ </rich:orderingList>
+
+ <rich:orderingList value="#{user.list}" var="item" >
+ <f:facet name="topControl">
+ U1
+ <h:outputText value="UF1" />
+ <h:outputText value="UF2" />
+ <h:outputText value="UF3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="upControl">
+ UU1
+ <h:outputText value="UUFF1" />
+ <h:outputText value="UUFF2" />
+ <h:outputText value="UUFF3" />
+ <span>UUSS1</span> UUTT1
+ </f:facet>
+ <f:facet name="downControl">
+ D1
+ <h:outputText value="DF1" />
+ <h:outputText value="DF2" />
+ <h:outputText value="DF3" />
+ <span>DS1</span> DT1
+ </f:facet>
+ <f:facet name="bottomControl">
+ DDW1
+ <h:outputText value="DDF1" />
+ <h:outputText value="DDF2" />
+ <h:outputText value="DDF3" />
+ <span>DDS1</span> DDT1
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Song Name" />
+ </f:facet>
+ <h:outputText value="[You must be evil] #{item}"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <f:facet name="footer">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ <h:outputText value="Artist Name" />
+ </f:facet>
+ <h:outputText value="[Chris Rea] #{item}"></h:outputText>
+ </rich:column>
+ </rich:orderingList>
+
+
+</h:panelGrid>
+
+<h1> 16) rich:progressBar </h1>
+
+<h:panelGrid columns="3" styleClass="panel">
+
+ <rich:progressBar value="67" style="color:red" styleClass="btn" mode="client"
+ id="progressBar">
+ <f:facet name="initial">
+ <h:outputText value="Process doesn't started yet" />
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process Done" />
+ </f:facet>
+ </rich:progressBar>
+
+ <rich:progressBar value="45">
+ <f:facet name="initial">
+ W1
+ <h:outputText value="F1" />
+ <h:outputText value="F2" />
+ <h:outputText value="F3" />
+ <span>S1</span> T1
+ </f:facet>
+ <f:facet name="complete">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+ </rich:progressBar>
+
+ <rich:progressBar value="30" label="Progres Bar" style="color:red" styleClass="btn" mode="client">
+ <f:facet name="complete">
+ WW1
+ <h:outputText value="FF1" />
+ <h:outputText value="FF2" />
+ <h:outputText value="FF3" />
+ <span>SS1</span> TT1
+ </f:facet>
+ <h:outputText> first text </h:outputText>
+ <h:outputText> Download speed 100 Mbit/s </h:outputText>
+ <h:outputText> last text </h:outputText>
+ </rich:progressBar>
+
+ <rich:progressBar value="30" >
+ </rich:progressBar>
+
+ <rich:progressBar value="45">
+ </rich:progressBar>
+
+</h:panelGrid>
+
+
+</f:view>
+</body>
+</html>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2012-02-10 11:05:27 UTC (rev 38595)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2012-02-10 11:09:23 UTC (rev 38596)
@@ -18,6 +18,7 @@
import org.jboss.tools.vpe.ui.test.dialog.VpeResourcesDialogTest;
import org.jboss.tools.vpe.ui.test.editor.CustomSashFormTest;
import org.jboss.tools.vpe.ui.test.editor.MultipleSelectionTest;
+import org.jboss.tools.vpe.ui.test.editor.ScrollingTest_Jbide8701;
import org.jboss.tools.vpe.ui.test.handlers.VpeCommandsTests;
import org.jboss.tools.vpe.ui.test.preferences.VpeEditorPreferencesPageTest;
@@ -27,7 +28,7 @@
*/
public class VpeUiTests {
public static final String IMPORT_PROJECT_NAME = "TestProject"; //$NON-NLS-1$
- public static Test suite(){
+ public static Test suite() {
TestSuite suite = new TestSuite("UI Tests for vpe"); //$NON-NLS-1$
suite.addTestSuite(VpeCommandsTests.class);
suite.addTestSuite(VpeResourcesDialogTest.class);
@@ -36,6 +37,7 @@
// suite.addTestSuite(VpePopupMenuTest.class);
suite.addTestSuite(VpeEditAnyDialogTest.class);
suite.addTestSuite(MultipleSelectionTest.class);
+ suite.addTestSuite(ScrollingTest_Jbide8701.class);
return new VpeTestSetup(suite);
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/ScrollingTest_Jbide8701.java 2012-02-10 11:09:23 UTC (rev 38596)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test.editor;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+import org.jboss.tools.vpe.base.test.TestUtil;
+import org.jboss.tools.vpe.base.test.VpeTest;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.VpeEditorPart;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.ui.test.VpeUiTests;
+import org.mozilla.interfaces.nsIDOMWindow;
+import org.mozilla.interfaces.nsIDOMWindowInternal;
+import org.mozilla.interfaces.nsIWebBrowser;
+
+public class ScrollingTest_Jbide8701 extends VpeTest {
+
+ private final String INITIALIZATION_FAILED = "Initialization failed!"; //$NON-NLS-1$
+ private final String FILE_NAME = "facets.jsp"; //$NON-NLS-1$
+ private final long DELAY_1S = 1*1000L;
+
+ public ScrollingTest_Jbide8701(String name) {
+ super(name);
+ }
+
+ public void testScrolling_Jbide8701() throws Throwable {
+ boolean testFinished = false;
+ IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME,
+ VpeUiTests.IMPORT_PROJECT_NAME);
+ assertNotNull("Specified file does not exist: file name = " + FILE_NAME //$NON-NLS-1$
+ + "; project name = " + VpeUiTests.IMPORT_PROJECT_NAME, file); //$NON-NLS-1$
+ /*
+ * Open file in the VPE
+ */
+ IEditorInput input = new FileEditorInput(file);
+ assertNotNull(INITIALIZATION_FAILED, input);
+
+ JSPMultiPageEditor part = openEditor(input);
+ assertNotNull(INITIALIZATION_FAILED, part);
+
+ VpeEditorPart vep = (VpeEditorPart) part.getVisualEditor();
+ assertNotNull(INITIALIZATION_FAILED, vep);
+
+ VpeController vc = TestUtil.getVpeController(part);
+ MozillaEditor visualEditor = vep.getVisualEditor();
+ StructuredTextEditor sourceEditor = vc. getSourceEditor();
+ if (visualEditor.getXulRunnerEditor() != null) {
+ nsIWebBrowser webBrowser = visualEditor.getXulRunnerEditor().getWebBrowser();
+ if (webBrowser != null) {
+ /*
+ * Initialize mozilla browser content window
+ */
+ nsIDOMWindow domWindow = webBrowser.getContentDOMWindow();
+ nsIDOMWindowInternal windowInternal = org.jboss.tools.vpe.xulrunner.util.XPCOM
+ .queryInterface(domWindow, nsIDOMWindowInternal.class);
+ /*
+ * Set property to enable scroll correlation
+ */
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(
+ IVpePreferencesPage.SYNCHRONIZE_SCROLLING_BETWEEN_SOURCE_VISUAL_PANES, true);
+ /*
+ * Set source position -- visual part should be scrolled.
+ */
+ int scrollX = windowInternal.getScrollX();
+ int scrollY = windowInternal.getScrollY();
+ assertEquals("Initital visual position is wrong", 0, scrollX); //$NON-NLS-1$
+ assertEquals("Initital visual position is wrong", 0, scrollY); //$NON-NLS-1$
+ sourceEditor.setFocus();
+ for (int i = 0; i < 15; i++) {
+ pressKeyCode(PlatformUI.getWorkbench().getDisplay(), SWT.PAGE_DOWN);
+ }
+ TestUtil.delay(DELAY_1S);
+ scrollX = windowInternal.getScrollX();
+ scrollY = windowInternal.getScrollY();
+ assertEquals("After 15x PG_DOWN presses visual position is wrong", 23, scrollX); //$NON-NLS-1$
+ assertEquals("After 15x PG_DOWN presses visual position is wrong", 658, scrollY); //$NON-NLS-1$
+ /*
+ * Set visual position -- source part should be scrolled.
+ */
+ domWindow.scrollTo(0,0);
+ TestUtil.delay(DELAY_1S);
+ int topIndex = sourceEditor.getTextViewer().getTopIndex();
+ assertEquals("Top source line is wrong", 74, topIndex); //$NON-NLS-1$
+ domWindow.scrollTo(0, windowInternal.getScrollMaxY()/2);
+ TestUtil.delay(DELAY_1S);
+ topIndex = sourceEditor.getTextViewer().getTopIndex();
+ assertEquals("Top source line for the middle position is wrong", 638, topIndex); //$NON-NLS-1$
+ testFinished = true;
+ }
+ }
+ assertTrue("Test hasn't passed all steps", testFinished); //$NON-NLS-1$
+ }
+
+ public static void pressKeyCode(Display display, int keyCode) {
+ Event keyPressed = new Event();
+ keyPressed.keyCode = keyCode;
+ keyPressed.type = SWT.KeyDown;
+ display.post(keyPressed);
+ Event keyReleased = new Event();
+ keyReleased.keyCode = keyCode;
+ keyReleased.type = SWT.KeyUp;
+ display.post(keyReleased);
+ }
+}
\ No newline at end of file
14 years, 2 months
JBoss Tools SVN: r38595 - trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 06:05:27 -0500 (Fri, 10 Feb 2012)
New Revision: 38595
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/PlatformIdentifierManager.java
Log:
JBIDE-10750 : missed proper eclipselink value
Modified: trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/PlatformIdentifierManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/PlatformIdentifierManager.java 2012-02-10 10:40:42 UTC (rev 38594)
+++ trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/PlatformIdentifierManager.java 2012-02-10 11:05:27 UTC (rev 38595)
@@ -27,7 +27,7 @@
public PlatformIdentifierManager() {
platformIdentifiers.add(new ReallySimplePlatformIdentifer("hibernate"));
- platformIdentifiers.add(new ReallySimplePlatformIdentifer("eclipse"));
+ platformIdentifiers.add(new ReallySimplePlatformIdentifer("eclipselink"));
}
public String identify(XmlPersistenceUnit xmlPersistenceUnit) {
14 years, 2 months
JBoss Tools SVN: r38594 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 05:40:42 -0500 (Fri, 10 Feb 2012)
New Revision: 38594
Modified:
trunk/build/aggregate/site/site.xml
Log:
JBIDE-10604 : move maven profile management to separate feature/plugins
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2012-02-10 10:34:56 UTC (rev 38593)
+++ trunk/build/aggregate/site/site.xml 2012-02-10 10:40:42 UTC (rev 38594)
@@ -186,7 +186,10 @@
<category name="AbridgedTools" />
<category name="MavenTools" />
</feature>
-
+ <feature url="features/org.jboss.tools.maven.profiles.feature_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="MavenTools" />
+ </feature>
<!-- only in JBT and JBDS Extras -->
<feature url="features/org.jboss.tools.maven.jbosspackaging.feature_0.0.0.jar" id="org.jboss.tools.maven.jbosspackaging.feature" version="0.0.0">
<category name="MavenTools" />
14 years, 2 months
JBoss Tools SVN: r38593 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-02-10 05:34:56 -0500 (Fri, 10 Feb 2012)
New Revision: 38593
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/server.properties
Log:
Posted server.properties to prevent HSQL calling System.exit()
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/server.properties
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/server.properties (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/server.properties 2012-02-10 10:34:56 UTC (rev 38593)
@@ -0,0 +1 @@
+server.no_system_exit=true
\ No newline at end of file
14 years, 2 months
JBoss Tools SVN: r38592 - in trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui: META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-10 05:24:46 -0500 (Fri, 10 Feb 2012)
New Revision: 38592
Added:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsEndpointModuleArtifact.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsPathModuleArtifactAdapter.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterClientDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterLaunchableAdapterDelegate.java
Removed:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
Log:
Open - Hook up WS Tester to the JAX-RS tooling
https://issues.jboss.org/browse/JBIDE-10609
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-10 09:43:28 UTC (rev 38591)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/META-INF/MANIFEST.MF 2012-02-10 10:24:46 UTC (rev 38592)
@@ -34,7 +34,8 @@
org.eclipse.core.commands;bundle-version="3.6.0",
org.eclipse.ltk.core.refactoring;bundle-version="3.5.200",
org.eclipse.wst.validation;bundle-version="1.2.300",
- org.eclipse.wst.server.core
+ org.eclipse.wst.server.core,
+ org.eclipse.debug.core;bundle-version="3.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-10 09:43:28 UTC (rev 38591)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/plugin.xml 2012-02-10 10:24:46 UTC (rev 38592)
@@ -320,7 +320,7 @@
<extension point="org.eclipse.wst.server.core.moduleArtifactAdapters">
<moduleArtifactAdapter
id="org.jboss.tools.ws.jaxrs.ui.jaxrsartifactadapter"
- class="org.jboss.tools.ws.jaxrs.ui.internal.utils.JaxrsPathModuleArtifactAdapter">
+ class="org.jboss.tools.ws.jaxrs.ui.internal.launcher.JaxrsPathModuleArtifactAdapter">
<enablement>
<with variable="selection">
<adapt type="org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement"/>
@@ -328,4 +328,20 @@
</enablement>
</moduleArtifactAdapter>
</extension>
+ <extension
+ point="org.eclipse.wst.server.core.clients">
+ <client
+ class="org.jboss.tools.ws.jaxrs.ui.internal.launcher.WSTesterClientDelegate"
+ id="org.jboss.tools.ws.jaxrs.ui.wsTesterClient">
+ </client>
+ </extension>
+ <extension
+ point="org.eclipse.wst.server.core.launchableAdapters">
+ <launchableAdapter
+ class="org.jboss.tools.ws.jaxrs.ui.internal.launcher.WSTesterLaunchableAdapterDelegate"
+ id="org.jboss.tools.ws.jaxrs.ui.wsTesterLaunchableAdapter"
+ priority="20"
+ typeIds="*">
+ </launchableAdapter>
+ </extension>
</plugin>
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsEndpointModuleArtifact.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsEndpointModuleArtifact.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsEndpointModuleArtifact.java 2012-02-10 10:24:46 UTC (rev 38592)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xavier Coulon - Initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.jaxrs.ui.internal.launcher;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
+
+/**
+ * Module Artifact that carries the JAX-RS Endpoint deployed on a server.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class JaxrsEndpointModuleArtifact implements IModuleArtifact {
+
+ /** the module.*/
+ private final IModule module;
+
+ /** the JAX-RS Endpoint that should be called.*/
+ private final IJaxrsEndpoint endpoint;
+
+ /**
+ * Full constructor.
+ * @param module
+ * @param endpoint
+ */
+ public JaxrsEndpointModuleArtifact(final IModule module, final IJaxrsEndpoint endpoint) {
+ this.module = module;
+ this.endpoint = endpoint;
+ }
+
+ @Override
+ public IModule getModule() {
+ return module;
+ }
+
+ public IJaxrsEndpoint getEndpoint() {
+ return endpoint;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsEndpointModuleArtifact.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsPathModuleArtifactAdapter.java (from rev 38525, trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java)
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsPathModuleArtifactAdapter.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsPathModuleArtifactAdapter.java 2012-02-10 10:24:46 UTC (rev 38592)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ ******************************************************************************/
+
+package org.jboss.tools.ws.jaxrs.ui.internal.launcher;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
+import org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement;
+
+/**
+ * This class adapts {@link UriPathTemplateElement} into WebResources that Eclipse Run|Debug On Server functionallity
+ * can handle.
+ *
+ * This allows you to use the Run As functionality on the JAX-RS node elements which represent a path.
+ *
+ * @author max
+ * @author Xavier Coulon
+ *
+ */
+public class JaxrsPathModuleArtifactAdapter extends ModuleArtifactAdapterDelegate {
+
+ /**
+ * Returns a JaxrsEndpointModuleArtifact if the given obj is an UriPathTemplateElement, null otherwise.
+ */
+ @Override
+ public IModuleArtifact getModuleArtifact(Object obj) {
+ if (obj instanceof UriPathTemplateElement) {
+ UriPathTemplateElement element = (UriPathTemplateElement) obj;
+ final IJaxrsEndpoint endpoint = element.getEndpoint();
+ if (endpoint != null) {
+ IProject project = endpoint.getJavaProject().getProject();
+ IModule module = ServerUtil.getModule(project);
+ return new JaxrsEndpointModuleArtifact(module, endpoint);
+ }
+ }
+
+ return null;
+ }
+
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/JaxrsPathModuleArtifactAdapter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterClientDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterClientDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterClientDelegate.java 2012-02-10 10:24:46 UTC (rev 38592)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ ******************************************************************************/
+package org.jboss.tools.ws.jaxrs.ui.internal.launcher;
+
+import java.lang.reflect.Method;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.model.ClientDelegate;
+import org.jboss.tools.ws.jaxrs.core.metamodel.IJaxrsEndpoint;
+import org.jboss.tools.ws.jaxrs.ui.JBossJaxrsUIPlugin;
+import org.jboss.tools.ws.jaxrs.ui.internal.utils.Logger;
+
+/**
+ * Custom client for the "Run as>Run as Server" launcher, that redirects the call to the WSTester instead of the Web
+ * Browser.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class WSTesterClientDelegate extends ClientDelegate {
+
+ /**
+ * Returns true if the given launchable is a JaxrsEndpointModuleArtifact, false otherwise
+ */
+ @Override
+ public boolean supports(IServer server, Object launchable, String launchMode) {
+ if (launchable instanceof JaxrsEndpointModuleArtifact) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Opens the WS Tester with the appropriate params.
+ */
+ public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch) {
+ if (launchable instanceof JaxrsEndpointModuleArtifact) {
+ JaxrsEndpointModuleArtifact artifact = (JaxrsEndpointModuleArtifact) launchable;
+ final IJaxrsEndpoint endpoint = artifact.getEndpoint();
+ final IModule module = artifact.getModule();
+ String endpointUri = computeEndpointURI(module, endpoint);
+ // Now we call the WS Tester through Reflection so there's no direct plug-in dependency
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+ String id = "org.jboss.tools.ws.ui.tester.views.TestWSView"; //$NON-NLS-1$
+ try {
+ IViewPart part = page.showView(id);
+ if (part != null
+ && part.getClass().getName().equalsIgnoreCase("org.jboss.tools.ws.ui.views.JAXRSWSTestView2")) { //$NON-NLS-1$
+ Class<?> c = part.getClass();
+ Class<?> parmtypes[] = new Class[2];
+ parmtypes[0] = String.class;
+ parmtypes[1] = String.class;
+ Method setURL = c.getDeclaredMethod("setJAXRS", parmtypes); //$NON-NLS-1$
+ if (setURL != null) {
+ Object arglist[] = new Object[2];
+ arglist[0] = endpointUri;
+ arglist[1] = endpoint.getHttpMethod().getHttpVerb();
+ setURL.invoke(part, arglist);
+ }
+ }
+ } catch (Exception e) {
+ Logger.error("Failed to open WS Tester", e);
+ return new Status(IStatus.ERROR, JBossJaxrsUIPlugin.PLUGIN_ID, "Failed to launch WS Tester", e);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * Creates the endpoint URI from the endpoint, by looking at the servers on which the module is deployed.
+ *
+ * @param element
+ * @return
+ */
+ private String computeEndpointURI(final IModule module, final IJaxrsEndpoint endpoint) {
+ String uriPathTemplate = endpoint.getUriPathTemplate();
+ IPath path = new Path(module.getName()).append(uriPathTemplate);
+ // check to see if this project has been deployed...
+ IServer[] servers = ServerUtil.getServersByModule(module, null);
+ if (servers == null || servers.length == 0) {
+ return "http://[domain]:[port]/" + path.toPortableString(); //$NON-NLS-1$
+ }
+ // if it's been deployed, we can grab the domain and web port
+ String domain = servers[0].getHost();
+ String webport = servers[0].getAttribute("org.jboss.ide.eclipse.as.core.server.webPort", "8080");//$NON-NLS-1$ //$NON-NLS-2$
+ return "http://" + domain + ':' + webport + "/" + path.toPortableString(); //$NON-NLS-1$
+
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterClientDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterLaunchableAdapterDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterLaunchableAdapterDelegate.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterLaunchableAdapterDelegate.java 2012-02-10 10:24:46 UTC (rev 38592)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ ******************************************************************************/
+package org.jboss.tools.ws.jaxrs.ui.internal.launcher;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+
+public class WSTesterLaunchableAdapterDelegate extends org.eclipse.wst.server.core.model.LaunchableAdapterDelegate {
+
+ public WSTesterLaunchableAdapterDelegate() {
+ }
+
+ /**
+ * Returns the given moduleArtifact if it is an JaxrsEndpointModuleArtifact, null otherwise.
+ */
+ @Override
+ public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException {
+ if (moduleArtifact instanceof JaxrsEndpointModuleArtifact) {
+ return moduleArtifact;
+ }
+ return null;
+ }
+}
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/launcher/WSTesterLaunchableAdapterDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java 2012-02-10 09:43:28 UTC (rev 38591)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/internal/utils/JaxrsPathModuleArtifactAdapter.java 2012-02-10 10:24:46 UTC (rev 38592)
@@ -1,49 +0,0 @@
-package org.jboss.tools.ws.jaxrs.ui.internal.utils;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-import org.eclipse.wst.server.core.util.WebResource;
-import org.jboss.tools.ws.jaxrs.ui.cnf.UriPathTemplateElement;
-
-/**
- * This class adapts {@link UriPathTemplateElement} into WebResources that Eclipse Run|Debug On Server functionallity can handle.
- *
- * This allows you to use the Run As functionality on the JAX-RS node elements which represent a path.
- *
- * @TODO currently only shows up for paths without "{" in them.
- * @author max
- *
- */
-public class JaxrsPathModuleArtifactAdapter extends ModuleArtifactAdapterDelegate {
-
- @Override
- public IModuleArtifact getModuleArtifact(Object obj) {
- if (obj instanceof UriPathTemplateElement) {
- UriPathTemplateElement element = (UriPathTemplateElement) obj;
-
- //TODO: NPE check this
- IProject project = element.getEndpoint().getJavaProject().getProject();
-
- IModule module = ServerUtil.getModule(project);
-
- if(plainUrl(element)) {
- Path path = new Path(element.getEndpoint().getUriPathTemplate());
- //TODO: need to take possible @Application context path into consideration!
- return new WebResource(module, path); //$NON-NLS-1$
- }
- }
-
- return null;
- }
-
- // @return true when the path is directly viewable in a browser and its a GET request.
- private boolean plainUrl(UriPathTemplateElement element) {
- //TODO: NPE check this
- return element.getEndpoint().getHttpMethod().getHttpVerb().equalsIgnoreCase("GET") && !element.getEndpoint().getUriPathTemplate().contains("{");
- }
-
-}
14 years, 2 months
JBoss Tools SVN: r38591 - in trunk/maven: features/org.jboss.tools.maven.profiles.feature and 33 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 04:43:28 -0500 (Fri, 10 Feb 2012)
New Revision: 38591
Added:
trunk/maven/features/org.jboss.tools.maven.profiles.feature/
trunk/maven/features/org.jboss.tools.maven.profiles.feature/.project
trunk/maven/features/org.jboss.tools.maven.profiles.feature/build.properties
trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.properties
trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.xml
trunk/maven/features/org.jboss.tools.maven.profiles.feature/license.html
trunk/maven/features/org.jboss.tools.maven.profiles.feature/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.classpath
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.project
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.jdt.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.m2e.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/META-INF/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/about.html
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/build.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/MavenProfilesCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.classpath
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.project
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.jdt.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.m2e.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/META-INF/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.html
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.ini
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.mappings
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/build.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/icons/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/icons/maven-profiles.gif
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/jboss_about.png
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Activator.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesLabelProvider.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelection.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionHandler.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionStatus.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/SelectProfilesDialog.java
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/messages.properties
Removed:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/
trunk/maven/plugins/org.jboss.tools.maven.ui/icons/
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/
Modified:
trunk/maven/features/pom.xml
trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
trunk/maven/plugins/pom.xml
trunk/maven/site/site.xml
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
Log:
JBIDE-10604 : move maven profile management to separate feature/plugins
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/.project
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/.project (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/.project 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/build.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/build.properties (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/build.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,4 @@
+bin.includes = feature*.*,\
+ license.html,\
+ p2.inf
+
\ No newline at end of file
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.properties
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.properties (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,53 @@
+###############################################################################
+# Copyright (c) 2010-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Maven Profiles Management
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=The feature brings an enhanced user interface for management of Maven profiles.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2010-2012 Red Hat, Inc. and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.xml (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/feature.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.maven.profiles.feature"
+ label="%featureName"
+ version="1.3.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.maven.profiles.ui">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.m2e.feature" version="1.0.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.maven.profiles.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.maven.profiles.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/license.html
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/license.html (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/license.html 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/maven/features/org.jboss.tools.maven.profiles.feature/pom.xml
===================================================================
--- trunk/maven/features/org.jboss.tools.maven.profiles.feature/pom.xml (rev 0)
+++ trunk/maven/features/org.jboss.tools.maven.profiles.feature/pom.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>features</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.features</groupId>
+ <artifactId>org.jboss.tools.maven.profiles.feature</artifactId>
+
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Modified: trunk/maven/features/pom.xml
===================================================================
--- trunk/maven/features/pom.xml 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/features/pom.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -24,6 +24,7 @@
<module>org.jboss.tools.maven.jaxrs.feature</module>
<module>org.jboss.tools.maven.jbosspackaging.feature</module>
<module>org.jboss.tools.maven.jpa.feature</module>
+ <module>org.jboss.tools.maven.profiles.feature</module>
</modules>
</project>
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/META-INF/MANIFEST.MF 2012-02-10 09:43:28 UTC (rev 38591)
@@ -31,5 +31,4 @@
Export-Package: org.jboss.tools.maven.core,
org.jboss.tools.maven.core.internal.project.facet,
org.jboss.tools.maven.core.libprov,
- org.jboss.tools.maven.core.profiles,
org.jboss.tools.maven.core.xpl
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -70,8 +70,6 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.jboss.tools.maven.core.internal.profiles.ProfileManager;
-import org.jboss.tools.maven.core.profiles.IProfileManager;
import org.osgi.framework.BundleContext;
/**
@@ -94,8 +92,6 @@
public static final List<LibraryProviderOperationConfig> libraryProviderOperationConfigs = new ArrayList<LibraryProviderOperationConfig>();
- private IProfileManager profileManager;
-
// The shared instance
private static MavenCoreActivator plugin;
@@ -114,7 +110,6 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- profileManager = new ProfileManager();
}
/*
@@ -771,8 +766,4 @@
IMavenConstants.PLUGIN_ID, -1, msg, ex));
}
}
-
- public IProfileManager getProfileManager() {
- return profileManager;
- }
}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.classpath
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.classpath (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.classpath 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.project
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.project (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.project 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.profiles.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.jdt.core.prefs 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,8 @@
+#Thu Feb 09 16:56:16 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/.settings/org.eclipse.m2e.core.prefs 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,5 @@
+#Thu Feb 09 16:56:14 CET 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/META-INF/MANIFEST.MF (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/META-INF/MANIFEST.MF 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.profiles.core; singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.maven.profiles.core.MavenProfilesCoreActivator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.m2e.core;bundle-version="[1.0.0,1.2.0)";visibility:=reexport,
+ org.eclipse.m2e.maven.runtime;bundle-version="[1.0.0,1.2.0)";visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.jboss.tools.maven.profiles.core,
+ org.jboss.tools.maven.profiles.core.profiles
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/about.html
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/about.html (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/about.html 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Maven Profile Management</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Maven Profile Management</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/build.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/build.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,4 @@
+#Properties file for org.jboss.tools.maven.profiles
+Bundle-Vendor = JBoss by Red Hat
+Bundle-Name = Maven Profiles Management
+JBoss_Maven_Integration=JBoss Maven Integration
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/plugin.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/pom.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/pom.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.plugins</groupId>
+ <artifactId>org.jboss.tools.maven.profiles.core</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/MavenProfilesCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/MavenProfilesCoreActivator.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/MavenProfilesCoreActivator.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,88 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.jboss.tools.maven.profiles.core.internal.profiles.ProfileManager;
+import org.jboss.tools.maven.profiles.core.profiles.IProfileManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class MavenProfilesCoreActivator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.maven.profiles.core"; //$NON-NLS-1$
+
+ private IProfileManager profileManager;
+
+ // The shared instance
+ private static MavenProfilesCoreActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public MavenProfilesCoreActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ profileManager = new ProfileManager();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static MavenProfilesCoreActivator getDefault() {
+ return plugin;
+ }
+
+ public static IStatus getStatus(String message) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, message);
+ }
+
+ public static IStatus getStatus(String message, Throwable e) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, message,e);
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
+ getDefault().getLog().log(status);
+ }
+
+ public IProfileManager getProfileManager() {
+ return profileManager;
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/Messages.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,34 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.core;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author snjeza
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.maven.core.messages"; //$NON-NLS-1$
+ public static String MavenFacetInstallDelegate_Internal_Error_creating_JBoss_Maven_Facet;
+ public static String MavenFacetInstallPage_The_artifactId_field_is_required;
+ public static String MavenFacetInstallPage_The_groupId_field_is_required;
+ public static String MavenFacetInstallPage_The_packaging_field_is_required;
+ public static String MavenFacetInstallPage_The_version_field_is_required;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/internal/profiles/ProfileManager.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,279 @@
+package org.jboss.tools.maven.profiles.core.internal.profiles;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Profile;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.SettingsUtils;
+import org.codehaus.plexus.util.StringUtils;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.maven.profiles.core.profiles.IProfileManager;
+import org.jboss.tools.maven.profiles.core.profiles.ProfileState;
+import org.jboss.tools.maven.profiles.core.profiles.ProfileStatus;
+
+public class ProfileManager implements IProfileManager {
+
+ public void updateActiveProfiles(final IMavenProjectFacade mavenProjectFacade,
+ final List<String> profiles,
+ final boolean isOffline,
+ final boolean isForceUpdate,
+ IProgressMonitor monitor) throws CoreException {
+ if (mavenProjectFacade == null) {
+ return;
+ }
+ final IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
+
+ IProject project = mavenProjectFacade.getProject();
+
+ final ResolverConfiguration configuration =configurationManager.getResolverConfiguration(project);
+
+ final String profilesAsString = getAsString(profiles);
+ if (profilesAsString.equals(configuration.getActiveProfiles())) {
+ //Nothing changed
+ return;
+ }
+
+ configuration.setActiveProfiles(profilesAsString);
+ boolean isSet = configurationManager.setResolverConfiguration(project, configuration);
+ if (isSet) {
+ MavenUpdateRequest request = new MavenUpdateRequest(project, isOffline, isForceUpdate);
+ configurationManager.updateProjectConfiguration(request, monitor);
+ }
+
+ }
+
+ private String getAsString(List<String> profiles) {
+ StringBuilder sb = new StringBuilder();
+ boolean addComma = false;
+ if (profiles != null){
+ for (String p : profiles) {
+ if (addComma) {
+ sb.append(", "); //$NON-NLS-1$
+ }
+ sb.append(p);
+ addComma = true;
+ }
+ }
+ return sb.toString();
+ }
+
+ public Map<Profile, Boolean> getAvailableSettingProfiles() throws CoreException {
+ Map<Profile, Boolean> settingsProfiles = new LinkedHashMap<Profile, Boolean>();
+ Settings settings = MavenPlugin.getMaven().getSettings();
+ List<String> activeProfiles = settings.getActiveProfiles();
+
+ for (org.apache.maven.settings.Profile sp : settings.getProfiles()) {
+ Profile p = SettingsUtils.convertFromSettingsProfile(sp);
+ boolean isAutomaticallyActivated = isActive(sp, activeProfiles);
+ settingsProfiles.put(p, isAutomaticallyActivated);
+ }
+ return Collections.unmodifiableMap(settingsProfiles);
+ }
+
+ private boolean isActive(Profile p, List<Profile> activeProfiles) {
+ for (Profile activeProfile : activeProfiles) {
+ if (activeProfile.getId().equals(p.getId())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isActive(org.apache.maven.settings.Profile p, List<String> activeProfiles) {
+ if (p.getActivation() != null && p.getActivation().isActiveByDefault()){
+ return true;
+ }
+ for (String activeProfile : activeProfiles) {
+ if (activeProfile.equals(p.getId())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<ProfileStatus> getProfilesStatuses(
+ IMavenProjectFacade facade,
+ IProgressMonitor monitor
+ ) throws CoreException {
+ if (facade == null) {
+ return Collections.emptyList();
+ }
+
+ ResolverConfiguration resolverConfiguration = MavenPlugin.getProjectConfigurationManager()
+ .getResolverConfiguration(facade.getProject());
+
+ List<String> configuredProfiles = resolverConfiguration.getActiveProfileList();
+
+ MavenProject mavenProject = facade.getMavenProject(monitor);
+
+
+ List<Model> modelHierarchy = new ArrayList<Model>();
+ getModelHierarchy(modelHierarchy, mavenProject.getModel(), new NullProgressMonitor());
+
+ List<Profile> availableProfiles = collectAvailableProfiles(modelHierarchy, new NullProgressMonitor());
+
+ final Map<Profile, Boolean> availableSettingsProfiles = getAvailableSettingProfiles();
+ Set<Profile> settingsProfiles = new HashSet<Profile>(availableSettingsProfiles.keySet());
+
+ List<ProfileStatus> statuses = new ArrayList<ProfileStatus>();
+
+ //First we put user configured profiles
+ for (String pId : configuredProfiles) {
+ if (StringUtils.isEmpty(pId)) continue;
+ boolean isDisabled = pId.startsWith("!");
+ String id = (isDisabled)?pId.substring(1):pId;
+ ProfileStatus status = new ProfileStatus(id);
+ status.setUserSelected(true);
+ ProfileState state = isDisabled?ProfileState.Disabled
+ :ProfileState.Active;
+ status.setActivationState(state);
+
+ Profile p = get(id, availableProfiles);
+
+ if (p == null){
+ p = get(id, settingsProfiles);
+ if(p != null){
+ status.setAutoActive(availableSettingsProfiles.get(p));
+ }
+ }
+
+ status.setSource(findSource(p, modelHierarchy));
+ statuses.add(status);
+ }
+
+ final List<Profile> activeProfiles = mavenProject.getActiveProfiles();
+ //Iterate on the remaining project profiles
+ addStatuses(statuses, availableProfiles, modelHierarchy, new ActivationPredicate() {
+ @Override
+ boolean isActive(Profile p) {
+ return ProfileManager.this.isActive(p, activeProfiles);
+ }
+ });
+
+ //Iterate on the remaining settings profiles
+ addStatuses(statuses, settingsProfiles, modelHierarchy, new ActivationPredicate() {
+ @Override
+ boolean isActive(Profile p) {
+ return availableSettingsProfiles.get(p);
+ }
+ });
+ return Collections.unmodifiableList(statuses);
+ }
+
+ private String findSource(Profile profile, List<Model> modelHierarchy) {
+ if (profile != null) {
+ if ("settings.xml".equals(profile.getSource())) { //$NON-NLS-1$
+ return profile.getSource();
+ }
+ for (Model m : modelHierarchy) {
+ for (Profile p : m.getProfiles()) {
+ if(p.equals(profile)) {
+ return //m.getGroupId()+ARTIFACT_SEPARATOR+
+ m.getArtifactId()
+ //+ (m.getVersion()==null?"":ARTIFACT_SEPARATOR+m.getVersion())//$NON-NLS-1$
+ ;
+ }
+ }
+ }
+ }
+ return "undefined"; //$NON-NLS-1$
+ }
+
+ protected List<Profile> collectAvailableProfiles(List<Model> models, IProgressMonitor monitor) throws CoreException {
+ List<Profile> profiles = new ArrayList<Profile>();
+ for (Model m : models) {
+ profiles.addAll(m.getProfiles());
+ }
+ return profiles;
+ }
+
+ protected List<Model> getModelHierarchy(List<Model> models, Model projectModel, IProgressMonitor monitor) throws CoreException {
+ if (projectModel == null) {
+ return null;
+ }
+ models.add(projectModel);
+ Parent p = projectModel.getParent();
+ if (p != null) {
+ Model parentModel = resolvePomModel(p.getGroupId(), p.getArtifactId(), p.getVersion(), monitor);
+ if (parentModel != null) {
+ getModelHierarchy(models, parentModel, monitor);
+ }
+ }
+ return models;
+ }
+
+ private Model resolvePomModel(String groupId, String artifactId, String version, IProgressMonitor monitor)
+ throws CoreException {
+ monitor.subTask(NLS.bind("Resolving {0}:{1}:{2}", new Object[] { groupId, artifactId, version}));
+
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getMavenProject(groupId, artifactId, version);
+ IMaven maven = MavenPlugin.getMaven();
+
+ if (facade != null) {
+ return facade.getMavenProject(monitor).getModel();
+ }
+
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "pom", null, repositories, monitor); //$NON-NLS-1$
+ File file = artifact.getFile();
+ if(file == null) {
+ return null;
+ }
+
+ return maven.readModel(file);
+ }
+
+ private void addStatuses(List<ProfileStatus> statuses, Collection<Profile> profiles, List<Model> modelHierarchy, ActivationPredicate predicate) {
+ for (Profile p : profiles) {
+ ProfileStatus status = new ProfileStatus(p.getId());
+ status.setSource(findSource(p, modelHierarchy));
+ boolean isActive = predicate.isActive(p);
+ ProfileState activationState = (isActive)?ProfileState.Active:ProfileState.Inactive;
+ status.setAutoActive(isActive);
+ status.setActivationState(activationState);
+ statuses.add(status);
+ }
+ }
+
+ private Profile get(String id, Collection<Profile> profiles) {
+ Iterator<Profile> ite = profiles.iterator();
+ Profile found = null;
+ while(ite.hasNext()) {
+ Profile p = ite.next();
+ if(p.getId().equals(id)) {
+ found = p;
+ ite.remove();
+ break;
+ }
+ }
+ return found;
+ }
+
+ private abstract class ActivationPredicate {
+ abstract boolean isActive(Profile p);
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/messages.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,6 @@
+MavenFacetInstallDelegate_Internal_Error_creating_JBoss_Maven_Facet=Internal Error creating JBoss Maven Facet. Missing configuration
+MavenFacetInstallPage_The_artifactId_field_is_required=The artifactId field is required.
+MavenFacetInstallPage_The_groupId_field_is_required=The groupId field is required.
+MavenFacetInstallPage_The_packaging_field_is_required=The packaging field is required.
+MavenFacetInstallPage_The_version_field_is_required=The version field is required.
+
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/IProfileManager.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,42 @@
+package org.jboss.tools.maven.profiles.core.profiles;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.model.Profile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+/**
+ * Retrieves and updates Maven profile informations for Maven projects
+ *
+ * @author Fred Bricon
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IProfileManager {
+
+ List<ProfileStatus> getProfilesStatuses(IMavenProjectFacade mavenProjectFacade, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns an unmodifiable Map of all the available profiles defined in the
+ * Maven settings.xml file.<br/>
+ * The value of each Map.Entry indicates if the profile is active.
+ * @return an unmodifiable Map of all the available profiles for a given project.
+ * @throws CoreException
+ */
+ Map<Profile, Boolean> getAvailableSettingProfiles() throws CoreException;
+
+ /**
+ * Update the profiles of the resolver configuration of a IMavenProjectFacade synchronously.
+ * @param mavenProjectFacade a facade of the maven project
+ * @param profiles the profile ids to use in the project's resolver configuration
+ * @param isOffline indicates if the maven request must be executed offline
+ * @param isForceUpdate indicates if a check for updated releases and snapshots on remote repositories must be forced.
+ * @param monitor a progress monitor
+ * @throws CoreException
+ */
+ void updateActiveProfiles(IMavenProjectFacade mavenProjectFacade,
+ List<String> profiles, boolean isOffline, boolean isForceUpdate, IProgressMonitor monitor)
+ throws CoreException;
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileState.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,18 @@
+package org.jboss.tools.maven.profiles.core.profiles;
+
+public enum ProfileState {
+ Disabled(false),
+ Inactive(false),
+ Active(true);
+
+ private boolean active;
+
+ ProfileState(boolean active) {
+ this.active = active;
+ }
+
+ public boolean isActive() {
+ return active;
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.core/src/org/jboss/tools/maven/profiles/core/profiles/ProfileStatus.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,100 @@
+package org.jboss.tools.maven.profiles.core.profiles;
+
+public class ProfileStatus {
+ private String id;
+ private boolean autoActive;
+ private boolean userSelected;
+ private ProfileState activationState;
+ private String source;
+
+ public ProfileStatus(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public boolean isAutoActive() {
+ return autoActive;
+ }
+
+ public void setAutoActive(boolean autoActive) {
+ this.autoActive = autoActive;
+ }
+
+ public ProfileState getActivationState() {
+ return activationState;
+ }
+ public void setActivationState(ProfileState activationState) {
+ this.activationState = activationState;
+ }
+ public String getSource() {
+ return source;
+ }
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public boolean isUserSelected() {
+ return userSelected;
+ }
+
+ public void setUserSelected(boolean userSelected) {
+ this.userSelected = userSelected;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((activationState == null) ? 0 : activationState.hashCode());
+ result = prime * result + (autoActive ? 1231 : 1237);
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((source == null) ? 0 : source.hashCode());
+ result = prime * result + (userSelected ? 1231 : 1237);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProfileStatus other = (ProfileStatus) obj;
+ if (activationState != other.activationState)
+ return false;
+ if (autoActive != other.autoActive)
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (source == null) {
+ if (other.source != null)
+ return false;
+ } else if (!source.equals(other.source))
+ return false;
+ if (userSelected != other.userSelected)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "ProfileStatus [id=" + id + ", autoActive=" + autoActive
+ + ", userSelected=" + userSelected + ", activationState="
+ + activationState + ", source=" + source + "]";
+ }
+
+
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.classpath
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.classpath (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.classpath 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.project
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.project (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.project 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.maven.profiles.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.jdt.core.prefs 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,8 @@
+#Thu Feb 09 16:56:17 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/.settings/org.eclipse.m2e.core.prefs 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,5 @@
+#Thu Feb 09 16:56:14 CET 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/META-INF/MANIFEST.MF (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/META-INF/MANIFEST.MF 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.jboss.tools.maven.profiles.ui;singleton:=true
+Bundle-Version: 1.3.0.qualifier
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.maven.profiles.ui.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.jst.common.project.facet.ui,
+ org.eclipse.wst.common.frameworks.ui,
+ org.eclipse.core.resources,
+ org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.2.0)",
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text,
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.jdt;bundle-version="3.7.0",
+ org.jboss.tools.maven.profiles.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.jboss.tools.maven.profiles.ui
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.html
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.html (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.html 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Maven Integration</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Maven Integration</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.ini
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.ini (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.ini 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.mappings
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.mappings (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.mappings 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/about.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,2 @@
+blurb=Maven Profiles Management UI\n\nVersion\: {featureVersion}\n\n(c) Copyright (c) Red Hat, Inc., contributors and others 2004 - 2010. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/build.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/build.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,12 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ jboss_about.png,\
+ about.properties,\
+ about.mappings,\
+ about.ini,\
+ about.html,\
+ plugin.properties,\
+ icons/
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/icons/maven-profiles.gif
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/icons/maven-profiles.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,6 @@
+Bundle-Vendor = JBoss by Red Hat
+Bundle-Name = Maven Profiles Management UI
+
+#Maven Profile selection menu
+Select_Maven_Profiles_Cmd= Select Maven Profiles
+Select_Maven_Profiles_Menu= Select Maven Profiles...
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <!-- Maven Profile Selection-->
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.ui.category.window"
+ id="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ name="%Select_Maven_Profiles_Cmd">
+ </command>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.jboss.tools.maven.profiles.ui.internal.ProfileSelectionHandler"
+ commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Ctrl+Alt+P">
+ </key>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromProject"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
+ class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ label="%Select_Maven_Profiles_Menu"
+ style="push"
+ definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ menubarPath="org.eclipse.m2e.core.mavenMenu/open"
+ enablesFor="+"/>
+ <visibility>
+ <and>
+ <objectState name="open" value="true"/>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </and>
+ </visibility>
+ </objectContribution>
+
+ <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromPom"
+ objectClass="org.eclipse.core.resources.IFile"
+ adaptable="true">
+ <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
+ class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ label="%Select_Maven_Profiles_Menu"
+ style="push"
+ definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ menubarPath="org.eclipse.m2e.core.fileMenu/open"
+ enablesFor="+"/>
+ <visibility>
+ <objectState name="name" value="pom.xml"/>
+ </visibility>
+ </objectContribution>
+
+ <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromWorkingSet"
+ adaptable="true"
+ objectClass="org.eclipse.ui.IWorkingSet">
+ <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
+ class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ label="%Select_Maven_Profiles_Menu"
+ style="push"
+ definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ menubarPath="org.eclipse.m2e.core.workingSetMenu/open"
+ enablesFor="+"/>
+ </objectContribution>
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
+ <toolbar
+ id="org.jboss.tools.maven.ui.toolbars.selectMavenProfilesToolbar">
+ <command
+ commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ icon="icons/maven-profiles.gif"
+ id="org.jboss.tools.maven.ui.toolbars.selectMavenProfilesCommand"
+ tooltip="%Select_Maven_Profiles_Cmd">
+ </command>
+ </toolbar>
+ </menuContribution>
+ </extension>
+</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/pom.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/pom.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.maven</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.maven.plugins</groupId>
+ <artifactId>org.jboss.tools.maven.profiles.ui</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Activator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Activator.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Activator.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,70 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.jboss.tools.maven.profiles.ui";
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e);
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message);
+ getDefault().getLog().log(status);
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Messages.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/Messages.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,59 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.maven.profiles.ui.messages"; //$NON-NLS-1$
+
+ public static String ProfileManager_Updating_maven_profiles;
+ public static String ProfileSelectionHandler_Loading_maven_profiles;
+ public static String ProfileSelectionHandler_Maven_Builder_still_processing;
+ public static String ProfileSelectionHandler_multiple_definitions;
+ public static String ProfileSelectionHandler_Select_some_maven_projects;
+ public static String ProfileSelectionHandler_Unable_to_open_profile_dialog;
+ public static String SelectProfilesDialog_autoactivated;
+ public static String SelectProfilesDialog_Activate_menu;
+ public static String SelectProfilesDialog_Active_Profiles_for_Project;
+ public static String SelectProfilesDialog_Available_profiles;
+ public static String SelectProfilesDialog_Warning_Common_profiles;
+ public static String SelectProfilesDialog_deactivated;
+ public static String SelectProfilesDialog_Deactivate_menu;
+ public static String SelectProfilesDialog_DeselectAll;
+ public static String SelectProfilesDialog_Force_update;
+ public static String SelectProfilesDialog_Maven_profile_selection;
+ public static String SelectProfilesDialog_Move_Down;
+ public static String SelectProfilesDialog_Move_Up;
+ public static String SelectProfilesDialog_No_Common_Profiles;
+ public static String SelectProfilesDialog_Offline;
+ public static String SelectProfilesDialog_Profile_id_header;
+ public static String SelectProfilesDialog_Profile_source_header;
+ public static String SelectProfilesDialog_Project_has_no_available_profiles;
+ public static String SelectProfilesDialog_Read_Only_profiles;
+ public static String SelectProfilesDialog_Select_active_profiles_for_selected_projects;
+ public static String SelectProfilesDialog_Select_Maven_profiles;
+ public static String SelectProfilesDialog_Select_the_active_Maven_profiles;
+ public static String SelectProfilesDialog_SelectAll;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveMavenProfilesNode.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,70 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.model.Profile;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.jboss.tools.maven.profiles.ui.Activator;
+
+
+/**
+ * Maven profile resource node
+ *
+ * @author Fred Bricon
+ */
+public class ActiveMavenProfilesNode implements IWorkbenchAdapter {
+
+ private Object[] ids = null;
+
+ public static ImageDescriptor icon = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/maven-profiles.png");
+
+
+ public ActiveMavenProfilesNode(List<Profile> profiles) {
+ ids = getProfileIds(profiles);
+ }
+
+ public Object[] getResources() {
+ return ids;
+ }
+
+ private Object[] getProfileIds(List<Profile> profiles) {
+ if(profiles != null && !profiles.isEmpty()) {
+ List<String> idList = new ArrayList<String>(profiles.size());
+ for (Profile p : profiles) {
+ idList.add(p.getId());
+ }
+ return idList.toArray();
+ }
+ return null;
+ }
+
+ public String getLabel(Object o) {
+ return "Active Maven profiles";
+ }
+
+ public ImageDescriptor getImageDescriptor(Object object) {
+ return icon;
+ }
+
+ public Object getParent(Object o) {
+ return null;
+ }
+
+ public Object[] getChildren(Object o) {
+ return ids;
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesContentProvider.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,58 @@
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.List;
+
+import org.apache.maven.model.Profile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+public class ActiveProfilesContentProvider implements ITreeContentProvider {
+
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof IProject) {
+ IProject project = (IProject) inputElement;
+ try {
+ if (project.isAccessible() && project.hasNature(IMavenConstants.NATURE_ID)) {
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(project);
+ if (facade != null && facade.getMavenProject() != null) {
+ List<Profile> profiles = facade.getMavenProject().getActiveProfiles();
+ return new Object[] { new ActiveMavenProfilesNode(profiles)};
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ return getElements(parentElement);
+ }
+
+ public Object getParent(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesLabelProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesLabelProvider.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ActiveProfilesLabelProvider.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,56 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+
+public class ActiveProfilesLabelProvider implements ILabelProvider {
+
+ //public static ImageDescriptor icon = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/maven-profiles.png");
+
+ public Image image = null;
+
+ public ActiveProfilesLabelProvider() {
+ //image = icon.createImage();
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ if (image != null) {
+ image.dispose();
+ }
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return true;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public Image getImage(Object element) {
+ return image;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof ActiveMavenProfilesNode) {
+ return ((ActiveMavenProfilesNode)element).getLabel(null);
+ } else if (element instanceof String) {
+ return element.toString();
+ }
+ return null;
+ }
+
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelection.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelection.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelection.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,59 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import org.jboss.tools.maven.profiles.core.profiles.ProfileState;
+
+public class ProfileSelection {
+ private String id;
+ private Boolean autoActive;
+ private Boolean selected;
+ private ProfileState activationState;
+ private String source;
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public Boolean getAutoActive() {
+ return autoActive;
+ }
+ public void setAutoActive(Boolean autoActive) {
+ this.autoActive = autoActive;
+ }
+ public Boolean getSelected() {
+ return selected;
+ }
+ public void setSelected(Boolean selected) {
+ this.selected = selected;
+ }
+ public ProfileState getActivationState() {
+ return activationState;
+ }
+ public void setActivationState(ProfileState activationState) {
+ this.activationState = activationState;
+ }
+ public String getSource() {
+ return source;
+ }
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String toMavenString() {
+ String s = id;
+ if (ProfileState.Disabled == activationState) {
+ s = "!"+id;
+ }
+ return s;
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionHandler.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionHandler.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionHandler.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,390 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.IMavenConstants;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.maven.profiles.core.MavenProfilesCoreActivator;
+import org.jboss.tools.maven.profiles.core.profiles.IProfileManager;
+import org.jboss.tools.maven.profiles.core.profiles.ProfileState;
+import org.jboss.tools.maven.profiles.core.profiles.ProfileStatus;
+import org.jboss.tools.maven.profiles.ui.Activator;
+import org.jboss.tools.maven.profiles.ui.Messages;
+
+/**
+ * Handles profile selection commands.
+ */
+public class ProfileSelectionHandler extends AbstractHandler {
+
+ /**
+ * Opens the Maven profile selection Dialog window.
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
+ Set<IMavenProjectFacade> facades = getSelectedMavenProjects(event);
+
+ if (facades.isEmpty()) {
+ display(window, Messages.ProfileSelectionHandler_Select_some_maven_projects);
+ return null;
+ }
+
+ final IProfileManager profileManager = MavenProfilesCoreActivator.getDefault().getProfileManager();
+
+ GetProfilesJob getProfilesJob = new GetProfilesJob(facades, profileManager);
+ getProfilesJob.addJobChangeListener(onProfilesFetched(getProfilesJob, facades, profileManager, window.getShell()));
+ getProfilesJob.setUser(true);
+ getProfilesJob.schedule();
+ return Status.OK_STATUS;
+ }
+
+ private IJobChangeListener onProfilesFetched(final GetProfilesJob getProfilesJob, final Set<IMavenProjectFacade> facades, final IProfileManager profileManager, final Shell shell) {
+ return new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ if (getProfilesJob.getResult().isOK()) {
+ shell.getDisplay().syncExec(new Runnable() {
+
+ public void run() {
+ List<ProfileSelection> sharedProfiles = getProfilesJob.getSharedProfiles();
+ Map<IMavenProjectFacade, List<ProfileStatus>> allProfiles = getProfilesJob.getAllProfiles();
+ final SelectProfilesDialog dialog = new SelectProfilesDialog(shell,
+ facades,
+ sharedProfiles);
+ if(dialog.open() == Dialog.OK) {
+ Job job = new UpdateProfilesJob(allProfiles, sharedProfiles, profileManager, dialog);
+ job.setRule( MavenPlugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
+ }
+ });
+
+ }
+ }
+ };
+ }
+
+ private void display(IWorkbenchWindow window, String message) {
+ MessageDialog.openInformation(
+ window.getShell(),
+ Messages.SelectProfilesDialog_Select_Maven_profiles,
+ message);
+ }
+
+ /**
+ * Returns an IMavenProjectFacade from the selected IResource, or from the
+ * active editor
+ *
+ * @param event
+ * @return the selected IMavenProjectFacade
+ */
+ private Set<IMavenProjectFacade> getSelectedMavenProjects(ExecutionEvent event) {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ IProject[] projects = getSelectedProjects(selection);
+ Set<IMavenProjectFacade> facades = new HashSet<IMavenProjectFacade>();
+ try {
+ if (projects.length == 0) {
+ IEditorInput input = HandlerUtil.getActiveEditorInput(event);
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ projects = new IProject[] { fileInput.getFile().getProject() };
+ }
+ }
+ IProgressMonitor monitor = new NullProgressMonitor();
+ for (IProject p : projects) {
+ if (p != null && p.isAccessible() && p.hasNature(IMavenConstants.NATURE_ID)) {
+ IFile pom = p.getFile(IMavenConstants.POM_FILE_NAME);
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().create(pom, true, monitor);
+ facades.add(facade);
+ }
+ }
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+
+ return facades;
+ }
+
+ private IProject[] getSelectedProjects(ISelection selection) {
+ Set<IProject> projects = new HashSet<IProject>();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Iterator<?> it = structuredSelection.iterator();
+ while (it.hasNext()) {
+ Object o = it.next();
+ if (o instanceof IResource) {
+ projects.add(((IResource) o).getProject());
+ } else if (o instanceof IWorkingSet) {
+ IAdaptable[] elements = ((IWorkingSet) o).getElements();
+ if (elements != null) {
+ for (IAdaptable e : elements) {
+ IProject p = (IProject) e.getAdapter(IProject.class);
+ if (p != null) {
+ projects.add(p);
+ }
+ }
+ }
+ } else if (o instanceof IAdaptable) {
+ IProject p = (IProject)((IAdaptable) o).getAdapter(IProject.class);
+ if (p != null) {
+ projects.add(p);
+ }
+ }
+ }
+ }
+ IProject[] array = new IProject[projects.size()];
+ projects.toArray(array);
+ return array;
+ }
+
+ class GetProfilesJob extends Job {
+
+ private IProfileManager profileManager;
+ private Set<IMavenProjectFacade> facades;
+ private Map<IMavenProjectFacade, List<ProfileStatus>> allProfiles;
+ private List<ProfileSelection> sharedProfiles;
+
+ private GetProfilesJob(final Set<IMavenProjectFacade> facades, IProfileManager profileManager) {
+ super(Messages.ProfileSelectionHandler_Loading_maven_profiles);
+ this.facades = facades;
+ this.profileManager = profileManager;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ this.allProfiles = getAllProfiles(facades, profileManager);
+ this.sharedProfiles = getSharedProfiles(allProfiles);
+ } catch (CoreException e) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ Messages.ProfileSelectionHandler_Unable_to_open_profile_dialog, e);
+ }
+ return Status.OK_STATUS;
+ }
+
+ private List<ProfileSelection> getSharedProfiles(
+ Map<IMavenProjectFacade, List<ProfileStatus>> projectProfilesMap) {
+
+ List<ProfileStatus> currentSelection = null;
+ List<List<ProfileStatus>> projectProfiles = new ArrayList<List<ProfileStatus>>(projectProfilesMap.values());
+ int smallestSize = Integer.MAX_VALUE;
+ for (List<ProfileStatus> profiles : projectProfiles) {
+ int size = profiles.size();
+ if (size < smallestSize) {
+ smallestSize = size;
+ currentSelection = profiles;
+ }
+ }
+ projectProfiles.remove(currentSelection);
+
+ // Init the smallest profiles selection possible
+ List<ProfileSelection> selection = new ArrayList<ProfileSelection>();
+ for (ProfileStatus p : currentSelection) {
+ ProfileSelection ps = new ProfileSelection();
+ ps.setId(p.getId());
+ ps.setActivationState(p.getActivationState());
+ ps.setAutoActive(p.isAutoActive());
+ ps.setSource(p.getSource());
+ ps.setSelected(p.isUserSelected());
+ selection.add(ps);
+ }
+
+ if (!projectProfiles.isEmpty()) {
+ // Restrict to the common profiles only
+ Iterator<ProfileSelection> ite = selection.iterator();
+
+ while (ite.hasNext()) {
+ ProfileSelection p = ite.next();
+ for (List<ProfileStatus> statuses : projectProfiles) {
+ ProfileStatus s = hasProfile(p.getId(), statuses);
+ if (s == null) {
+ // remove any non-common profile selection
+ ite.remove();
+ break;
+ }
+ // reset non common settings
+ if (p.getAutoActive() != null && !p.getAutoActive().equals(s.isAutoActive())) {
+ p.setAutoActive(null);
+ }
+ if (p.getSource() != null && !p.getSource().equals(s.getSource())) {
+ p.setSource(Messages.ProfileSelectionHandler_multiple_definitions);
+ }
+ if (p.getSelected() != null && !p.getSelected().equals(s.isUserSelected())) {
+ p.setSelected(null);
+ }
+ if (p.getActivationState() != null && !p.getActivationState().equals(s.getActivationState())) {
+ p.setActivationState(null);
+ p.setAutoActive(null);
+ }
+ }
+ }
+ }
+
+ return selection;
+ }
+
+ private ProfileStatus hasProfile(String id, List<ProfileStatus> statuses) {
+ for (ProfileStatus p : statuses) {
+ if (id.equals(p.getId())) {
+ return p;
+ }
+ }
+ return null;
+ }
+
+ private Map<IMavenProjectFacade, List<ProfileStatus>> getAllProfiles(final Set<IMavenProjectFacade> facades,
+ final IProfileManager profileManager) throws CoreException {
+ Map<IMavenProjectFacade, List<ProfileStatus>> allProfiles =
+ new HashMap<IMavenProjectFacade, List<ProfileStatus>>(facades.size());
+ IProgressMonitor monitor = new NullProgressMonitor();
+ for (IMavenProjectFacade facade : facades) {
+ allProfiles.put(facade, profileManager.getProfilesStatuses(facade, monitor));
+ }
+ return allProfiles;
+ }
+
+ public List<ProfileSelection> getSharedProfiles() {
+ return sharedProfiles;
+ }
+
+ public Map<IMavenProjectFacade, List<ProfileStatus>> getAllProfiles() {
+ return allProfiles;
+ }
+ }
+
+ class UpdateProfilesJob extends WorkspaceJob {
+
+ private Map<IMavenProjectFacade, List<ProfileStatus>> allProfiles;
+ private List<ProfileSelection> sharedProfiles;
+ private IProfileManager profileManager;
+ private SelectProfilesDialog dialog;
+
+ private UpdateProfilesJob(Map<IMavenProjectFacade, List<ProfileStatus>> allProfiles,
+ List<ProfileSelection> sharedProfiles, IProfileManager profileManager, SelectProfilesDialog dialog) {
+ super(Messages.ProfileManager_Updating_maven_profiles);
+ this.allProfiles = allProfiles;
+ this.sharedProfiles = sharedProfiles;
+ this.profileManager = profileManager;
+ this.dialog = dialog;
+ }
+
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.ProfileManager_Updating_maven_profiles, 100);
+ SubMonitor subProgress = SubMonitor.convert(progress.newChild(5), allProfiles.size() * 100);
+ for (Map.Entry<IMavenProjectFacade, List<ProfileStatus>> entry : allProfiles.entrySet()) {
+ if (progress.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ IMavenProjectFacade facade = entry.getKey();
+ List<String> activeProfiles = getActiveProfiles(sharedProfiles, entry.getValue());
+
+ profileManager.updateActiveProfiles(facade, activeProfiles,
+ dialog.isOffline(), dialog.isForceUpdate(), subProgress.newChild(100));
+ }
+ } catch (CoreException ex) {
+ Activator.log(ex);
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+
+ private List<String> getActiveProfiles(
+ List<ProfileSelection> sharedProfiles,
+ List<ProfileStatus> availableProfiles) {
+ List<String> ids = new ArrayList<String>();
+
+ for (ProfileStatus st : availableProfiles) {
+ ProfileSelection selection = findSelectedProfile(st.getId(), sharedProfiles);
+ String id = null;
+ boolean isDisabled = false;
+ if (selection == null) {
+ // was not displayed. Use existing value.
+ if (st.isUserSelected()) {
+ id = st.getId();
+ isDisabled = st.getActivationState().equals(ProfileState.Disabled);
+ }
+ } else {
+ if (null == selection.getSelected()) {
+ // Value was displayed but its state is unknown, use
+ // previous state
+ if (st.isUserSelected()) {
+ id = st.getId();
+ isDisabled = st.getActivationState().equals(ProfileState.Disabled);
+ }
+ } else {
+ // Value was displayed and is consistent
+ if (Boolean.TRUE.equals(selection.getSelected())) {
+ id = selection.getId();
+ isDisabled = selection.getActivationState().equals(ProfileState.Disabled);
+ }
+ }
+ }
+
+ if (id != null) {
+ if (isDisabled) {
+ id = "!" + id; //$NON-NLS-1$
+ }
+ ids.add(id);
+ }
+ }
+ return ids;
+ }
+
+ private ProfileSelection findSelectedProfile(String id,
+ List<ProfileSelection> sharedProfiles) {
+ for (ProfileSelection sel : sharedProfiles) {
+ if (id.equals(sel.getId())) {
+ return sel;
+ }
+ }
+ return null;
+ }
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionStatus.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionStatus.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileSelectionStatus.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,15 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+public enum ProfileSelectionStatus {
+ Undefined, Inactivated, Activated, Disabled
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/ProfileUtil.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,27 @@
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.Collection;
+
+public class ProfileUtil {
+
+ private ProfileUtil(){}
+
+ private static final String COMMA = ", ";
+
+ public static String toString(Collection<ProfileSelection> profiles) {
+ StringBuilder sb = new StringBuilder();
+ if(profiles != null && !profiles.isEmpty()) {
+ boolean addComma = false;
+ for (ProfileSelection ps : profiles) {
+ if (Boolean.TRUE.equals(ps.getSelected())) {
+ if (addComma) {
+ sb.append(COMMA);
+ }
+ sb.append(ps.toMavenString());
+ addComma = true;
+ }
+ }
+ }
+ return sb.toString();
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/SelectProfilesDialog.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/SelectProfilesDialog.java 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,609 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableColorProvider;
+import org.eclipse.jface.viewers.ITableFontProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.maven.profiles.core.profiles.ProfileState;
+import org.jboss.tools.maven.profiles.ui.Messages;
+
+public class SelectProfilesDialog extends TitleAreaDialog implements
+ IMenuListener {
+
+ private static int PROFILE_ID_COLUMN = 0;
+ private static int SOURCE_COLUMN = 1;
+
+ private CheckboxTableViewer profileTableViewer;
+ private Button offlineModeBtn;
+ private Button forceUpdateBtn;
+ //private ITextViewer profilesTextViewer;
+ private Text profilesText;
+
+ private boolean offlineMode ;
+ private boolean forceUpdate;
+
+ List<ProfileSelection> sharedProfiles;
+ Set<IMavenProjectFacade> facades;
+ IMavenProjectFacade facade;
+
+ final Action activationAction = new ChangeProfileStateAction(ProfileState.Active);
+
+ final Action deActivationAction = new ChangeProfileStateAction(ProfileState.Disabled);
+ private Label warningImg;
+ private Label warningLabel;
+
+ public SelectProfilesDialog(Shell parentShell, Set<IMavenProjectFacade> facades,
+ List<ProfileSelection> sharedProfiles) {
+ super(parentShell);
+ setShellStyle(super.getShellStyle() | SWT.RESIZE | SWT.MODELESS);
+ offlineMode = MavenPlugin.getMavenConfiguration().isOffline();
+ this.facades = facades;
+ if(facades.size() == 1){
+ facade = facades.iterator().next();
+ }
+ this.sharedProfiles = sharedProfiles;
+ }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(Messages.SelectProfilesDialog_Select_Maven_profiles);
+ }
+
+
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite area = (Composite) super.createDialogArea(parent);
+
+ Composite container = new Composite(area, SWT.NONE);
+ container.setEnabled(true);
+
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginLeft = 12;
+ container.setLayout(layout);
+ container.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ setTitle(Messages.SelectProfilesDialog_Maven_profile_selection);
+ String text;
+ boolean hasProfiles = !sharedProfiles.isEmpty();
+ if (facade == null) {
+ text = NLS.bind(Messages.SelectProfilesDialog_Select_active_profiles_for_selected_projects,
+ facades.size()
+ );
+ } else {
+ text = NLS.bind(
+ Messages.SelectProfilesDialog_Select_the_active_Maven_profiles,
+ facade.getProject().getName());
+ if (hasProfiles) {
+ displayProfilesAsText(container);
+ }
+ }
+ setMessage(text);
+
+ if (hasProfiles && facade == null) {
+ displayWarning(container);
+ }
+
+ Label lblAvailable = new Label(container, SWT.NONE);
+ lblAvailable.setLayoutData(new GridData(SWT.WRAP, SWT.CENTER, true,
+ false, 2, 1));
+
+ String textLabel = getAvailableText(hasProfiles);
+ lblAvailable.setText(textLabel);
+
+ if (hasProfiles) {
+
+ displayProfilesTable(container);
+
+ addSelectionButton(container, Messages.SelectProfilesDialog_SelectAll, true);
+ addSelectionButton(container, Messages.SelectProfilesDialog_DeselectAll, false);
+ addActivationButton(container, "Activate", ProfileState.Active);
+ addActivationButton(container, "Deactivate", ProfileState.Disabled);
+ offlineModeBtn = addCheckButton(container, Messages.SelectProfilesDialog_Offline, offlineMode);
+ forceUpdateBtn = addCheckButton(container, Messages.SelectProfilesDialog_Force_update, forceUpdate);
+ }
+
+ return area;
+ }
+
+ private void displayWarning(Composite container) {
+ warningImg = new Label(container, SWT.CENTER);
+ warningLabel = new Label(container, SWT.NONE);
+ warningLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(warningImg);
+ warningImg.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING));
+ warningLabel.setText( Messages.SelectProfilesDialog_Warning_Common_profiles);
+ }
+
+ private String getAvailableText(boolean hasProfiles) {
+ String textLabel;
+ if (hasProfiles) {
+ textLabel = Messages.SelectProfilesDialog_Available_profiles;
+ } else {
+ if (facade == null) {
+ textLabel = NLS.bind(Messages.SelectProfilesDialog_No_Common_Profiles,
+ facades.size());
+ } else {
+ textLabel =
+ NLS.bind(Messages.SelectProfilesDialog_Project_has_no_available_profiles,
+ facade.getProject().getName());
+ }
+ }
+ return textLabel;
+ }
+
+ private void displayProfilesTable(Composite container) {
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4);
+ gd.heightHint = 200;
+ gd.widthHint = 500;
+
+ profileTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER | SWT.MULTI);
+ Table table = profileTableViewer.getTable();
+ table.setFocus();
+ table.setLayoutData(gd);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+
+ TableColumn profileColumn = new TableColumn(table, SWT.NONE);
+ profileColumn.setText(Messages.SelectProfilesDialog_Profile_id_header);
+ profileColumn.setWidth(350);
+
+ TableColumn sourceColumn = new TableColumn(table, SWT.NONE);
+ sourceColumn.setText(Messages.SelectProfilesDialog_Profile_source_header);
+ sourceColumn.setWidth(120);
+
+
+ profileTableViewer.setContentProvider(ArrayContentProvider.getInstance());
+
+ profileTableViewer.setLabelProvider(new ProfileLabelProvider(container
+ .getFont()));
+
+
+ profileTableViewer.addCheckStateListener(new ICheckStateListener() {
+
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ ProfileSelection profile = (ProfileSelection) event.getElement();
+ if (profileTableViewer.getGrayed(profile)) {
+ profileTableViewer.setGrayed(profile, false);
+ }
+ profile.setSelected(profileTableViewer.getChecked(profile));
+ if (Boolean.FALSE.equals(profile.getSelected())
+ || profile.getActivationState() == null) {
+ profile.setActivationState(ProfileState.Active);
+ }
+
+ updateProfilesAsText();
+ profileTableViewer.refresh();
+ }
+ });
+
+ profileTableViewer.setInput(sharedProfiles);
+
+ createMenu();
+ }
+
+ private void displayProfilesAsText(Composite container) {
+ Label profilesLabel = new Label(container, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project,
+ facade.getProject().getName()));
+
+ profilesText = new Text(container, SWT.BORDER);
+ profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ profilesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
+ profilesText.setEditable(false);
+ profilesText.setToolTipText(Messages.SelectProfilesDialog_Read_Only_profiles);
+
+ updateProfilesAsText();
+ }
+
+ private void updateProfilesAsText() {
+ if (profilesText != null) {
+ profilesText.setText(ProfileUtil.toString(sharedProfiles));
+ }
+ }
+
+ private Button addCheckButton(Composite container, String label, boolean selected) {
+ Button checkBtn = new Button(container, SWT.CHECK);
+ checkBtn.setText(label);
+ checkBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER,
+ true, false, 2, 1));
+ checkBtn.setSelection(selected);
+ return checkBtn;
+ }
+
+ private Button addSelectionButton(Composite container, String label, final boolean ischecked) {
+ Button button = new Button(container, SWT.NONE);
+ button.setLayoutData(new GridData(SWT.FILL, SWT.UP,
+ false, false, 1, 1));
+ button.setText(label);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ profileTableViewer.setAllGrayed(false);
+ for (ProfileSelection profile : sharedProfiles) {
+ profileTableViewer.setChecked(profile, ischecked);
+ profile.setSelected(ischecked);
+ if (!ischecked || profile.getActivationState() == null) {
+ profile.setActivationState(ProfileState.Active);
+ }
+ }
+ refresh();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+
+ return button;
+ }
+
+ private Button addActivationButton(Composite container, String label, final ProfileState state) {
+ Button button = new Button(container, SWT.NONE);
+ button.setLayoutData(new GridData(SWT.FILL, SWT.UP,
+ false, false, 1, 1));
+ button.setText(label);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ ISelection s = profileTableViewer.getSelection();
+ if (s instanceof IStructuredSelection) {
+ IStructuredSelection sel = (IStructuredSelection) s;
+ setActivationState(sel, state);
+ }
+ refresh();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+
+ return button;
+ }
+
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ if (profileTableViewer != null) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ }
+
+ @Override
+ protected void okPressed() {
+ if (profileTableViewer != null) {
+ offlineMode = offlineModeBtn.getSelection();
+ forceUpdate = forceUpdateBtn.getSelection();
+ }
+ super.okPressed();
+ }
+
+ private void createMenu() {
+ MenuManager menuMgr = new MenuManager();
+ Menu contextMenu = menuMgr.createContextMenu(profileTableViewer
+ .getControl());
+ menuMgr.addMenuListener(this);
+ profileTableViewer.getControl().setMenu(contextMenu);
+ menuMgr.setRemoveAllWhenShown(true);
+
+ for (ProfileSelection p : sharedProfiles) {
+ Boolean selected = p.getSelected();
+ if (selected ==null || p.getActivationState() == null) {
+ profileTableViewer.setGrayed(p, true);
+ profileTableViewer.setChecked(p, true);
+ } else if(selected != null) {
+ profileTableViewer.setChecked(p, selected );
+ }
+ }
+ }
+
+ public void menuAboutToShow(IMenuManager manager) {
+
+ IStructuredSelection selection = (IStructuredSelection) profileTableViewer
+ .getSelection();
+ if (!selection.isEmpty()) {
+ boolean multiSelection = selection.size() > 1;
+ ProfileState state = null;
+ String selectionText;
+ String text;
+ if (multiSelection) {
+ selectionText = "selected profiles";
+ } else {
+ ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
+ state = entry.getActivationState();
+ selectionText = entry.getId();
+ }
+
+ if ( state == null || ProfileState.Disabled.equals(state)) {
+ text = Messages.SelectProfilesDialog_Activate_menu;
+ activationAction.setText(NLS.bind(text, selectionText));
+ manager.add(activationAction);
+ }
+ if( !ProfileState.Disabled.equals(state)) {
+ text = Messages.SelectProfilesDialog_Deactivate_menu;
+ deActivationAction.setText(NLS.bind(text, selectionText));
+ manager.add(deActivationAction);
+ }
+ }
+ }
+
+ public boolean isOffline() {
+ return offlineMode;
+ }
+
+ public boolean isForceUpdate() {
+ return forceUpdate;
+ }
+
+
+ /* TODO add content assist to the profiles input text
+ private ITextViewer createTextInput(Composite container) {
+ ITextViewer textViewer = new TextViewer(container, SWT.BORDER | SWT.FILL);
+ textViewer.setDocument(new Document());
+ final ContentAssistant contentAssistant = new ContentAssistant();
+ contentAssistant.enableAutoActivation(true);
+ contentAssistant.setAutoActivationDelay(100);
+ contentAssistant.enableAutoInsert(true);
+ contentAssistant.setContentAssistProcessor(new ProfileContentAssistProcessor(sharedProfiles),
+ IDocument.DEFAULT_CONTENT_TYPE);
+
+ textViewer.getTextWidget().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if ( (e.character == ' ') && ((e.stateMask & SWT.CTRL) != 0) ) {
+ contentAssistant.showPossibleCompletions();
+ }
+ }
+ });
+
+
+ contentAssistant.install(textViewer );
+ return textViewer;
+ }
+
+ private final class ProfileContentAssistProcessor implements
+ IContentAssistProcessor {
+
+ private List<String> profileIds;
+
+ public ProfileContentAssistProcessor(
+ List<ProfileSelection> possibleProfiles) {
+ assert possibleProfiles != null;
+ profileIds = new ArrayList<String>(possibleProfiles.size());
+ for (ProfileSelection ps : possibleProfiles) {
+ profileIds.add(ps.getId());
+ }
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[]{','};
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int documentOffset) {
+ IDocument document = viewer.getDocument();
+ int currOffset = documentOffset -1;
+ ICompletionProposal[] proposals = null;
+ try {
+ String currentWord = getCurrentWord(document, currOffset);
+ System.err.println(currOffset + " - Current word "+currentWord); //$NON-NLS-1$
+
+ int currentWordLength = currentWord.length();
+ List<ICompletionProposal> suggestions = new ArrayList<ICompletionProposal>(profileIds.size());
+ for (String id : profileIds) {
+ if (!id.startsWith(currentWord)) {
+ continue;
+ }
+
+ ICompletionProposal proposal = new CompletionProposal(id,
+ documentOffset - currentWordLength,
+ currentWordLength,
+ id.length());
+
+ suggestions.add(proposal);
+ }
+ if (!suggestions.isEmpty()) {
+ proposals = new ICompletionProposal[suggestions.size()];
+ suggestions.toArray(proposals);
+ }
+ } catch (BadLocationException e) {
+ System.err.println(e);
+ }
+ return proposals;
+ }
+
+
+ private String getCurrentWord(IDocument document, int currOffset)
+ throws BadLocationException {
+ StringBuilder currWord = new StringBuilder();
+ char currChar;
+
+ while (currOffset > -1
+ && !Character.isWhitespace(currChar = document
+ .getChar(currOffset))
+ && ',' != currChar) {
+ currWord.insert(0, currChar);
+ currOffset--;
+ }
+ return currWord.toString();
+ }
+ }
+ */
+
+ private void setActivationState(final IStructuredSelection sel, ProfileState state) {
+ if (sel == null) return;
+ Iterator<?> ite = sel.iterator();
+ while (ite.hasNext()) {
+ Object o = ite.next();
+ if (o instanceof ProfileSelection) {
+ ProfileSelection ps = (ProfileSelection) o;
+ ps.setActivationState(state);
+ profileTableViewer.setGrayed(ps, false);
+ if (ProfileState.Disabled.equals(state)) {
+ profileTableViewer.setChecked(ps, true);
+ ps.setSelected(true);
+ }
+ }
+ }
+ }
+
+
+ private void refresh() {
+ profileTableViewer.refresh();
+ updateProfilesAsText();
+ }
+
+
+ private class ChangeProfileStateAction extends Action {
+
+ private final ProfileState state;
+
+ public ChangeProfileStateAction(ProfileState state) {
+ this.state = state;
+ }
+
+ @Override
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection) profileTableViewer
+ .getSelection();
+ if (!selection.isEmpty()) {
+ setActivationState(selection, state);
+ refresh();
+ }
+ super.run();
+ }
+ }
+
+ private class ProfileLabelProvider extends LabelProvider implements
+ ITableLabelProvider, ITableFontProvider, ITableColorProvider {
+
+ private Font implicitActivationFont;
+
+ private Color inactiveColor;
+
+ public ProfileLabelProvider(Font defaultFont) {
+ FontData[] fds = defaultFont.getFontData();
+ for (FontData fd : fds) {
+ fd.setStyle(SWT.ITALIC);
+ }
+ implicitActivationFont = new Font(defaultFont.getDevice(), fds);
+ inactiveColor = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
+ }
+
+ public Font getFont(Object element, int columnIndex) {
+ ProfileSelection entry = (ProfileSelection) element;
+ Font font = null;
+ if (Boolean.TRUE.equals(entry.getAutoActive())
+ && PROFILE_ID_COLUMN == columnIndex) {
+ font = implicitActivationFont;
+ }
+ return font;
+ }
+
+ public Color getForeground(Object element, int columnIndex) {
+ ProfileSelection entry = (ProfileSelection) element;
+ if (ProfileState.Disabled.equals(entry.getActivationState())) {
+ return inactiveColor;
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element, int columnIndex) {
+ return null;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ ProfileSelection entry = (ProfileSelection) element;
+ StringBuilder text = new StringBuilder();
+ if (entry != null) {
+ if (columnIndex == PROFILE_ID_COLUMN) {
+ text.append(entry.getId());
+ ProfileState state = entry.getActivationState();
+ if (Boolean.TRUE.equals(entry.getSelected())
+ && state == ProfileState.Disabled) {
+ text.append(Messages.SelectProfilesDialog_deactivated);
+ } else if (Boolean.TRUE.equals(entry.getAutoActive())) {
+ text.append(Messages.SelectProfilesDialog_autoactivated);
+ }
+ } else if (columnIndex == SOURCE_COLUMN) {
+ text.append(entry.getSource());
+ }
+ }
+ return text.toString();
+ }
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/messages.properties (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/messages.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -0,0 +1,28 @@
+ProfileManager_Updating_maven_profiles=Updating maven profiles
+ProfileSelectionHandler_Loading_maven_profiles=Loading project profiles
+ProfileSelectionHandler_Maven_Builder_still_processing=The maven builder has not finished processing the selected project(s) yet.
+ProfileSelectionHandler_multiple_definitions=multiple definitions
+ProfileSelectionHandler_Select_some_maven_projects=You must select at least one active Maven project
+ProfileSelectionHandler_Unable_to_open_profile_dialog=Unable to open the Maven Profile selection dialog
+SelectProfilesDialog_Activate_menu=Activate {0}
+SelectProfilesDialog_Active_Profiles_for_Project=Active profiles for {0} :
+SelectProfilesDialog_autoactivated=\ (auto activated)
+SelectProfilesDialog_Available_profiles=Available profiles :
+SelectProfilesDialog_Warning_Common_profiles=Only the profiles common to all selected projects are displayed. Other profiles will not be affected.
+SelectProfilesDialog_Deactivate_menu=Deactivate {0}
+SelectProfilesDialog_deactivated=\ (deactivated)
+SelectProfilesDialog_DeselectAll=Deselect all
+SelectProfilesDialog_Force_update=Force update
+SelectProfilesDialog_Maven_profile_selection=Maven Profile selection
+SelectProfilesDialog_Move_Down=Move Down
+SelectProfilesDialog_Move_Up=Move Up
+SelectProfilesDialog_No_Common_Profiles=There are no common profiles for the {0} selected projects.
+SelectProfilesDialog_Offline=Offline
+SelectProfilesDialog_Profile_id_header=Profile id
+SelectProfilesDialog_Profile_source_header=Source
+SelectProfilesDialog_Project_has_no_available_profiles=Project {0} has no available profiles
+SelectProfilesDialog_Read_Only_profiles=Active profiles area is read-only
+SelectProfilesDialog_Select_active_profiles_for_selected_projects=Select the active Maven profiles for the {0} selected projects. Right-click to (de)activate a profile.
+SelectProfilesDialog_Select_Maven_profiles=Select Maven profiles
+SelectProfilesDialog_Select_the_active_Maven_profiles=Select the active Maven profiles for project {0}. Right-click to (de)activate a profile.
+SelectProfilesDialog_SelectAll=Select All
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/build.properties 2012-02-10 09:43:28 UTC (rev 38591)
@@ -8,5 +8,4 @@
about.mappings,\
about.ini,\
about.html,\
- plugin.properties,\
- icons/
+ plugin.properties
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -28,98 +28,7 @@
point="org.eclipse.core.runtime.preferences">
<initializer class="org.jboss.tools.maven.ui.preferences.ConfiguratorPreferencesInitializer"/>
</extension>
-
- <!-- Maven Profile Selection-->
- <extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.ui.category.window"
- id="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- name="%Select_Maven_Profiles_Cmd">
- </command>
- </extension>
-
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.jboss.tools.maven.ui.internal.profiles.ProfileSelectionHandler"
- commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand">
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- contextId="org.eclipse.ui.contexts.window"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="Ctrl+Alt+P">
- </key>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromProject"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true">
- <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles_Menu"
- style="push"
- definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- menubarPath="org.eclipse.m2e.core.mavenMenu/open"
- enablesFor="+"/>
- <visibility>
- <and>
- <objectState name="open" value="true"/>
- <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
- </and>
- </visibility>
- </objectContribution>
-
- <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromPom"
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true">
- <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles_Menu"
- style="push"
- definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- menubarPath="org.eclipse.m2e.core.fileMenu/open"
- enablesFor="+"/>
- <visibility>
- <objectState name="name" value="pom.xml"/>
- </visibility>
- </objectContribution>
-
- <objectContribution id="org.jboss.tools.maven.ui.profiles.selectFromWorkingSet"
- adaptable="true"
- objectClass="org.eclipse.ui.IWorkingSet">
- <action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles_Menu"
- style="push"
- definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- menubarPath="org.eclipse.m2e.core.workingSetMenu/open"
- enablesFor="+"/>
- </objectContribution>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
- <toolbar
- id="org.jboss.tools.maven.ui.toolbars.selectMavenProfilesToolbar">
- <command
- commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- icon="icons/maven-profiles.gif"
- id="org.jboss.tools.maven.ui.toolbars.selectMavenProfilesCommand"
- tooltip="%Select_Maven_Profiles_Cmd">
- </command>
- </toolbar>
- </menuContribution>
- </extension>
-
+
<extension point="org.eclipse.ui.editors.templates">
<template id="org.jboss.tools.maven.editor.xml.templates.repository.jboss.public"
contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.repositories"
Modified: trunk/maven/plugins/pom.xml
===================================================================
--- trunk/maven/plugins/pom.xml 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/plugins/pom.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -24,6 +24,8 @@
<module>org.jboss.tools.maven.jaxrs</module>
<module>org.jboss.tools.maven.jbosspackaging</module>
<module>org.jboss.tools.maven.jpa</module>
+ <module>org.jboss.tools.maven.profiles.core</module>
+ <module>org.jboss.tools.maven.profiles.ui</module>
</modules>
</project>
Modified: trunk/maven/site/site.xml
===================================================================
--- trunk/maven/site/site.xml 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/site/site.xml 2012-02-10 09:43:28 UTC (rev 38591)
@@ -38,4 +38,7 @@
<feature url="features/org.jboss.tools.maven.test.feature_0.0.0.jar" id="org.jboss.tools.maven.test.feature" version="0.0.0">
<category name="JBoss Tools maven Nightly Build Update Site"/>
</feature>
+ <feature url="features/org.jboss.tools.maven.profiles.feature_0.0.0.jar" id="org.jboss.tools.maven.profiles.feature" version="0.0.0">
+ <category name="JBoss Tools maven Nightly Build Update Site"/>
+ </feature>
</site>
Modified: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2012-02-10 09:15:16 UTC (rev 38590)
+++ trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/META-INF/MANIFEST.MF 2012-02-10 09:43:28 UTC (rev 38591)
@@ -23,7 +23,9 @@
org.eclipse.wst.server.core,
org.jboss.tools.seam.core,
org.eclipse.datatools.connectivity,
- org.eclipse.datatools.connectivity.db.generic
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.maven.profiles.core,
+ org.jboss.tools.maven.profiles.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
14 years, 2 months
JBoss Tools SVN: r38590 - trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-10 04:15:16 -0500 (Fri, 10 Feb 2012)
New Revision: 38590
Modified:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java
Log:
JBIDE-10750 : fixed test case where eclipselink not available in the TP
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java 2012-02-10 09:14:33 UTC (rev 38589)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JpaConfiguratorTest.java 2012-02-10 09:15:16 UTC (rev 38590)
@@ -27,19 +27,20 @@
return;
}
-
assertIsJpaProject(project, JpaFacet.VERSION_2_0);
assertNoErrors(project);
JpaProjectManager manager = JptJpaCorePlugin.getJpaProjectManager();
JpaProject jpa = manager.getJpaProject(project);
- assertTrue(jpa.getJpaPlatform().getId() + " is not the expected eclipselink platform", jpa.getJpaPlatform().getId().startsWith("eclipselink"));
+ String pid = jpa.getJpaPlatform().getId();
+ assertTrue(pid + " is not the expected platform", pid.startsWith("eclipselink") || pid.startsWith("generic"));
project = importProject( "projects/jpa/simple-1.0/pom.xml");
waitForJobsToComplete();
assertIsJpaProject(project, JpaFacet.VERSION_1_0);
assertNoErrors(project);
jpa = manager.getJpaProject(project);
- assertTrue(jpa.getJpaPlatform().getId() + " is not the expected hibernate platform", jpa.getJpaPlatform().getId().startsWith("hibernate"));
+ pid = jpa.getJpaPlatform().getId();
+ assertTrue(pid + " is not the expected hibernate platform", pid.startsWith("hibernate"));
}
protected void assertIsJpaProject(IProject project, IProjectFacetVersion expectedJpaVersion) throws Exception {
14 years, 2 months