JBoss Tools SVN: r12840 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: src/org/jboss/tools/jsf/vpe/jsf/test/jbide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-12-30 08:02:23 -0500 (Tue, 30 Dec 2008)
New Revision: 12840
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
Fixing junit tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml 2008-12-30 12:34:51 UTC (rev 12839)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/jbide3214test.xhtml.xml 2008-12-30 13:02:23 UTC (rev 12840)
@@ -6,14 +6,14 @@
</COLGROUP>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
<TD STYLE="background-color: green;" CLASS="dr-table-cell rich-table-cell">
-<SPAN>
+<SPAN CLASS="vpe-text">
#{test.color}
</SPAN>
</TD>
</TR>
</TABLE>
<DIV CLASS="dr-table-hidden" STYLE="overflow: auto; width: 100px; height: 100px;">
-<TABLE CLASS="dr-table rich-table">
+<TABLE CLASS="dr-table rich-sdt">
<COLGROUP SPAN="1">
</COLGROUP>
<TBODY HEIGHT="100" STYLE="background-color: blue;" WIDTH="100px;">
@@ -50,9 +50,6 @@
</COLGROUP>
<TBODY>
</TBODY>
-<SPAN>
-ssssssssss
-</SPAN>
</TABLE>
</DIV>
</test>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-12-30 12:34:51 UTC (rev 12839)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-12-30 13:02:23 UTC (rev 12840)
@@ -79,7 +79,7 @@
boolean str_exists=false;
for (ICompletionProposal completionProposal : results) {
String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
- if(displayString.startsWith("${msg.")) { //$NON-NLS-1$
+ if(displayString.startsWith("msg.")) { //$NON-NLS-1$
str_exists=true;
}
@@ -115,7 +115,7 @@
// Tests CA
ICompletionProposal[] results =checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml","",21,58); //$NON-NLS-1$//$NON-NLS-2$
assertNotNull(results);
- assertTrue(results.length>2);
+ assertTrue(results.length>=2);
for(ICompletionProposal completionProposal : results) {
if(completionProposal instanceof AutoContentAssistantProposal ) {
String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
16 years
JBoss Tools SVN: r12839 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-12-30 07:34:51 -0500 (Tue, 30 Dec 2008)
New Revision: 12839
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
Log:
JUnit test for rich:progressBar was updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2008-12-30 07:36:42 UTC (rev 12838)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2008-12-30 12:34:51 UTC (rev 12839)
@@ -6,19 +6,10 @@
<DIV CLASS="rich-progress-bar-height rich-progress-bar-uploaded null"
STYLE="height: 13px; width: 60%;">
<DIV
- STYLE="height: 13px; font-weight: bold; position: relative; text-align: center;"> #{progressBarBean.currentValue} %
+ STYLE="height: 13px; font-weight: bold; position: relative; text-align: center;">
+ #{progressBarBean.currentValue} %
+ </DIV>
</DIV>
</DIV>
-<DIV>
-<SPAN STYLE="display: none; -moz-user-modify: read-only;"><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
-
-</SPAN>
-</DIV>
-<DIV>
-<SPAN STYLE="display: none; -moz-user-modify: read-only;"><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
-
-</SPAN>
-</DIV>
-</DIV>
</test>
</tests>
\ No newline at end of file
16 years
JBoss Tools SVN: r12838 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert: src/org/jboss/tools/jbpm/convert/b2j/translate and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-30 02:36:42 -0500 (Tue, 30 Dec 2008)
New Revision: 12838
Removed:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
Log:
JBIDE-3471: if a subprocess have only a default task, then there are not gpd.xml for this subprocess in generated jpdl folder.
Deleted: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties 2008-12-29 14:27:45 UTC (rev 12837)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties 2008-12-30 07:36:42 UTC (rev 12838)
@@ -1,2 +0,0 @@
-## index of importer -> set(imports)
-#Fri Dec 26 15:31:28 CST 2008
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-12-29 14:27:45 UTC (rev 12837)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-12-30 07:36:42 UTC (rev 12838)
@@ -113,8 +113,10 @@
for (String bpmnID : map.keySet()) {
if (bpmnID != null) {
// when translate bpmn loop activity, we create a mock
- // structure and when translate bpmn transaction, we create a
- // mock structure too. For these reason, we need to give a (x,y)
+ // structure
+ // when translate bpmn transaction, we create a
+ // mock structure too.
+ // For these reasons, we need to give a (x,y)
// increment to avoid two element overlap
int xIncre = 0;
int yIncre = 0;
@@ -161,11 +163,10 @@
eleList);
xIncre = 300;
yIncre = 200;
+ } else if(bpmnID.endsWith(Constants.Bpmn_Pool_Element_Name)){
+ continue;
}
}
- if (bpmnGpdEle == null) {
- continue;
- }
translateGraphicalElement(TranslateHelper.getXY(bpmnGpdEle,
xIncre, yIncre), map.get(bpmnID), eleList);
}
@@ -179,7 +180,7 @@
return;
}
- // if not translate, then translate the pool of the element
+ // if not translate the element's pool, then translate the pool of the element
if (!gpdPoolNames.contains(jpdlEle.getParent().attributeValue(
Constants.Dom_Element_Name))
&& Constants.Jpdl_Process_Definition_Element_Name
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-12-29 14:27:45 UTC (rev 12837)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-12-30 07:36:42 UTC (rev 12838)
@@ -152,7 +152,7 @@
/*
* select the elements from process. These elements have no transitions sub
- * element or have transtions to end-state.
+ * element or have transitions to end-state.
*/
public static List<Element> locateLastElements(Element processRoot) {
List<Element> list = new ArrayList<Element>();
@@ -164,16 +164,14 @@
Element subEle = ((Element) ele)
.element(Constants.Jpdl_Transition_Element);
if (subEle != null
- && endState
- .attributeValue(Constants.Dom_Element_Name)
+ && endState.attributeValue(Constants.Dom_Element_Name)
.equals(subEle.attributeValue(Constants.To))) {
list.add((Element) ele);
}
}
} else {
for (Object ele : processRoot.elements()) {
- if (((Element) ele)
- .element(Constants.Jpdl_Transition_Element) == null) {
+ if (((Element) ele).element(Constants.Jpdl_Transition_Element) == null) {
list.add((Element) ele);
}
}
@@ -189,8 +187,7 @@
List<Element> eleList) {
Element element = null;
for (Element ele : eleList) {
- String str = ele
- .attributeValue(Constants.Bpmn_Href_Attribute_Name);
+ String str = ele.attributeValue(Constants.Bpmn_Href_Attribute_Name);
if (str != null && str.contains(bpmnID)) {
element = ele;
break;
@@ -228,8 +225,7 @@
String width, String height) {
Element ele = DomXmlWriter.addElement(parentEle, name);
DomXmlWriter.addAttribute(ele, Constants.Width_Attribute_Name, width);
- DomXmlWriter.addAttribute(ele, Constants.Height_Attribute_Name,
- height);
+ DomXmlWriter.addAttribute(ele, Constants.Height_Attribute_Name, height);
return ele;
}
@@ -267,14 +263,19 @@
*/
public static String[] getXY(Element bpmnGpdEle, int xIncre, int yIncre) {
String xy[] = new String[2];
- xy[0] = String.valueOf(Integer.parseInt(bpmnGpdEle
- .attributeValue(Constants.X_Attribute_Name) == null ? "0"
- : bpmnGpdEle.attributeValue(Constants.X_Attribute_Name))
- + xIncre);
- xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
- .attributeValue(Constants.Y_Attribute_Name) == null ? "0"
- : bpmnGpdEle.attributeValue(Constants.Y_Attribute_Name))
- + yIncre);
+ if (bpmnGpdEle == null) {
+ xy[0] = String.valueOf(xIncre);
+ xy[1] = String.valueOf(yIncre);
+ } else {
+ xy[0] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(Constants.X_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(Constants.X_Attribute_Name))
+ + xIncre);
+ xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(Constants.Y_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(Constants.Y_Attribute_Name))
+ + yIncre);
+ }
return xy;
}
16 years
JBoss Tools SVN: r12837 - in documentation/trunk/movies: seam_demo and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-29 09:27:45 -0500 (Mon, 29 Dec 2008)
New Revision: 12837
Modified:
documentation/trunk/movies/hbm_xml_editing/hbm_xml_editing.wnk
documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-352
demo is reviewed, language is checked, time on frames is corrected
Modified: documentation/trunk/movies/hbm_xml_editing/hbm_xml_editing.wnk
===================================================================
(Binary files differ)
Modified: documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
===================================================================
(Binary files differ)
16 years
JBoss Tools SVN: r12836 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml: src/org/jboss/tools/seam/pages/xml/model/helpers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-12-29 08:47:04 -0500 (Mon, 29 Dec 2008)
New Revision: 12836
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
Log:
JBIDE-3466
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-12-29 12:55:41 UTC (rev 12835)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-12-29 13:47:04 UTC (rev 12836)
@@ -2891,6 +2891,7 @@
<XChildEntity maxCount="1" name="SeamPageRaiseEvent20"/>
<XChildEntity maxCount="1" name="SeamPageRender"/>
<XChildEntity maxCount="1" name="SeamPageRedirect21"/>
+ <XChildEntity name="SeamPageRule21"/>
</XChildrenEntities>
<XEntityRenderer>
<ICONS>
@@ -2920,6 +2921,18 @@
<AttributeData AttributeName="value"/>
</EntityData>
</XActionItem>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddRuleHandler"
+ ICON="action.empty"
+ PROPERTIES="validator.add=true;entity=SeamPageRule21;renderEntity=SeamPageRender;redirectEntity=SeamPageRedirect21;key=SeamPage_AddRule"
+ WizardClassName="%Default%" displayName="Add Rule..." kind="action" name="AddRule">
+ <EntityData EntityName="AddSeamPageRule">
+ <AttributeData AttributeName="kind" Mandatory="no"/>
+ <AttributeData AttributeName="view id"/>
+ <AttributeData AttributeName="if outcome" Mandatory="no"/>
+ <AttributeData AttributeName="if" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
<XActionItem HIDE="disabled"
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2008-12-29 12:55:41 UTC (rev 12835)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2008-12-29 13:47:04 UTC (rev 12836)
@@ -106,12 +106,14 @@
if(!entity.startsWith(ENT_NAVIGATION)) continue;
if(entity.startsWith(ENT_NAVIGATION_RULE)) {
addTarget(ns[j], true);
- } else {
- XModelObject[] rs = ns[j].getChildren();
- for (int k = 0; k < rs.length; k++) {
- addTarget(rs[k], true);
+ if(!entity.endsWith(SUFF_21)) {
+ continue;
}
}
+ XModelObject[] rs = ns[j].getChildren();
+ for (int k = 0; k < rs.length; k++) {
+ addTarget(rs[k], true);
+ }
}
}
@@ -303,16 +305,19 @@
if(result == null) result = new ArrayList<XModelObject>();
result.add(t);
}
- } else {
- XModelObject[] rs = ns[i].getChildren();
- for (int k = 0; k < rs.length; k++) {
- XModelObject t = getTargetChild(rs[k]);
- if(t != null) {
- if(result == null) result = new ArrayList<XModelObject>();
- result.add(t);
- }
+ if(!entity.endsWith(SUFF_21)) {
+ continue;
}
}
+ XModelObject[] rs = ns[i].getChildren();
+ for (int k = 0; k < rs.length; k++) {
+ XModelObject t = getTargetChild(rs[k]);
+ if (t != null) {
+ if (result == null) result = new ArrayList<XModelObject>();
+ result.add(t);
+ }
+ }
+
}
return result == null ? new XModelObject[0]
: result.toArray(new XModelObject[0]);
16 years
JBoss Tools SVN: r12835 - trunk/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: izhukov
Date: 2008-12-29 07:55:41 -0500 (Mon, 29 Dec 2008)
New Revision: 12835
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
JBIDE-1977: fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-29 10:01:09 UTC (rev 12834)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-12-29 12:55:41 UTC (rev 12835)
@@ -27,7 +27,7 @@
target="org.eclipse.jst.jsp.core.jspsource"/>
<provisionalConfiguration
type="structuredtextfoldingprovider"
- class="org.eclipse.jst.jsp.ui.internal.projection.StructuredTextFoldingProviderJSP"
+ class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderJSP"
target="org.eclipse.jst.jsp.core.jspsource"/>
<provisionalDefinition
type="preferencepages"
@@ -99,6 +99,16 @@
type="preferencepages"
value="org.eclipse.wst.sse.ui.preferences.jsp.occurrences"
target="org.eclipse.wst.html.core.htmlsource"/>
+ <provisionalConfiguration
+ class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+ target="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"
+ type="structuredtextfoldingprovider">
+ </provisionalConfiguration>
+ <provisionalConfiguration
+ class="org.eclipse.wst.xml.ui.internal.projection.StructuredTextFoldingProviderXML"
+ target="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor"
+ type="structuredtextfoldingprovider">
+ </provisionalConfiguration>
</extension>
16 years
JBoss Tools SVN: r12834 - trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-29 05:01:09 -0500 (Mon, 29 Dec 2008)
New Revision: 12834
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
JBIDE-3469: change the bpmn -> jpdl wizard page logic to support to generate jpdl files directly without any settings
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-12-29 09:38:08 UTC (rev 12833)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-12-29 10:01:09 UTC (rev 12834)
@@ -168,6 +168,10 @@
setPageComplete(false);
}
}
+
+ public boolean canFlipToNextPage() {
+ return isPageComplete();
+ }
public Map<String, String> getIdMap() {
return idMap;
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-12-29 09:38:08 UTC (rev 12833)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-12-29 10:01:09 UTC (rev 12834)
@@ -52,6 +52,7 @@
// bpmn pool id:name map
private Map<String, String> idMap;
private boolean isOverWrite = true;
+ private boolean isDoTranslation = false;
protected String bpmnFileName;
protected String bpmnFileParentPath;
@@ -134,8 +135,7 @@
public IWizardPage getNextPage(IWizardPage page) {
if (page.getName().equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
errorList = translateBpmnToStrings();
- errorPage.setPageComplete(true);
-
+ isDoTranslation = true;
if (errorList.size() == 0) {
return locationPage;
}
@@ -148,6 +148,9 @@
}
public boolean performFinish() {
+ if(!isDoTranslation){
+ translateBpmnToStrings();
+ }
createGeneratedFile(this.isOverWrite());
refreshWorkspace();
return true;
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-12-29 09:38:08 UTC (rev 12833)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-12-29 10:01:09 UTC (rev 12834)
@@ -56,5 +56,9 @@
public void setListViewer(TableViewer listViewer) {
this.listViewer = listViewer;
}
+
+ public boolean isPageComplete() {
+ return true;
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-12-29 09:38:08 UTC (rev 12833)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-12-29 10:01:09 UTC (rev 12834)
@@ -105,7 +105,7 @@
}
public boolean isPageComplete() {
- if (viewer != null && viewer.getSelection() == null) {
+ if (viewer == null || viewer.getSelection() == null) {
return false;
}
return true;
16 years
JBoss Tools SVN: r12833 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-12-29 04:38:08 -0500 (Mon, 29 Dec 2008)
New Revision: 12833
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2017
corrected in accordance with eclipse 3.2+ version
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-12-26 19:50:59 UTC (rev 12832)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-12-29 09:38:08 UTC (rev 12833)
@@ -380,15 +380,6 @@
}
}
- public Object getService(Class api) {
- // TODO megration to eclipse 3.2
- return null;
- }
-
- public boolean hasService(Class api) {
- // TODO megration to eclipse 3.2
- return false;
- }
public void dispose() {
ISelectionProvider provider = getSelectionProvider();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-12-26 19:50:59 UTC (rev 12832)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2008-12-29 09:38:08 UTC (rev 12833)
@@ -11,19 +11,35 @@
package org.jboss.tools.jst.jsp.jspeditor;
import java.util.ArrayList;
+
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.util.Assert;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorActionBarContributor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IKeyBindingService;
+import org.eclipse.ui.INestableKeyBindingService;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.internal.PartSite;
import org.eclipse.ui.internal.PopupMenuExtender;
import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.services.IServiceLocatorCreator;
+import org.eclipse.ui.internal.services.IWorkbenchLocationService;
+import org.eclipse.ui.internal.services.ServiceLocator;
+import org.eclipse.ui.internal.services.WorkbenchLocationService;
+import org.eclipse.ui.services.IDisposable;
+import org.eclipse.ui.services.IServiceScopes;
/**
*
@@ -44,12 +60,33 @@
private ArrayList fMenuExts;
+ private final ServiceLocator serviceLocator;
+
public JSPMultiPageEditorSite(JSPMultiPageEditorPart multiPageEditor,
IEditorPart editor) {
Assert.isNotNull(multiPageEditor);
Assert.isNotNull(editor);
this.fEditor = multiPageEditor;
this.fEditorPart = editor;
+
+ this.serviceLocator = (ServiceLocator) ((IServiceLocatorCreator) multiPageEditor
+ .getSite().getService(IServiceLocatorCreator.class))
+ .createServiceLocator(multiPageEditor.getSite(), null,
+ new IDisposable() {
+ public void dispose() {
+ final Control control = ((PartSite) getMultiPageEditor()
+ .getSite()).getPane().getControl();
+ if (control != null && !control.isDisposed()) {
+ ((PartSite) getMultiPageEditor().getSite())
+ .getPane().doHide();
+ }
+ }
+ });
+ serviceLocator.registerService(IWorkbenchLocationService.class,
+ new WorkbenchLocationService(IServiceScopes.MPESITE_SCOPE,
+ getWorkbenchWindow().getWorkbench(),
+ getWorkbenchWindow(), multiPageEditor.getSite(), this,
+ null, 3));
}
public void dispose() {
@@ -168,10 +205,13 @@
if (fMenuExts == null) {
fMenuExts = new ArrayList(1);
}
+ PopupMenuExtender extender = findMenuExtender(menuMgr, selProvider);
if (findMenuExtender(menuMgr, selProvider) == null) {
- PopupMenuExtender extender = new PopupMenuExtender(menuID, menuMgr,
+ extender = new PopupMenuExtender(menuID, menuMgr,
selProvider, fEditorPart);
fMenuExts.add(extender);
+ }else {
+ extender.addMenuId(menuID);
}
}
@@ -203,7 +243,7 @@
}
public IWorkbenchPart getPart() {
- return null;
+ return this.fEditor;
}
public final void registerContextMenu(final MenuManager menuManager,
@@ -221,4 +261,16 @@
fMenuExts = new ArrayList(1);
}
}
+
+ public Object getService(Class api) {
+ // TODO megration to eclipse 3.2
+ return this.serviceLocator.getService(api);
+ }
+
+ public boolean hasService(Class api) {
+ // TODO megration to eclipse 3.2
+ return this.serviceLocator.hasService(api);
+ }
+
+
}
16 years
JBoss Tools SVN: r12832 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-12-26 14:50:59 -0500 (Fri, 26 Dec 2008)
New Revision: 12832
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamDeclarationsHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamReferencesHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/OpenSeamComponentHandler.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2509
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamDeclarationsHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamDeclarationsHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamDeclarationsHandler.java 2008-12-26 19:50:59 UTC (rev 12832)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.handlers;
+
+import org.jboss.tools.seam.ui.search.SeamSearchScope;
+
+public class FindSeamDeclarationsHandler extends FindSeamHandler {
+
+ /**
+ * Returns the search limitation to declarations
+ */
+ protected int getLimitTo() {
+ return SeamSearchScope.SEARCH_FOR_DECLARATIONS;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamDeclarationsHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java 2008-12-26 19:50:59 UTC (rev 12832)
@@ -0,0 +1,395 @@
+/*******************************************************************************
+ * 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.handlers;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+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.runtime.IStatus;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
+import org.eclipse.jdt.internal.ui.search.SearchMessages;
+import org.eclipse.jdt.internal.ui.search.SearchUtil;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.progress.IProgressService;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
+import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.search.SeamSearchQuery;
+import org.jboss.tools.seam.ui.search.SeamSearchScope;
+
+abstract public class FindSeamHandler extends AbstractHandler implements ISelectionListener{
+
+ /**
+ * @Override
+ */
+ public void run() {
+
+ }
+ /*
+ * Returns editor from a given workbench window
+ *
+ * @param window
+ * @return
+ */
+ private IEditorPart getCurrentEditor(IWorkbenchWindow window) {
+ if (window == null || window.getActivePage() == null)
+ return null;
+
+ return window.getActivePage().getActiveEditor();
+ }
+
+ /*
+ * Returns viewer for a given editor
+ *
+ * @param editor
+ * @return
+ */
+ private ISourceViewer getEditorViewer(IWorkbenchPart editor) {
+ ISourceViewer viewer = null;
+
+ if (editor instanceof EditorPartWrapper) {
+ editor = ((EditorPartWrapper)editor).getEditor();
+ }
+ if (editor instanceof JSPMultiPageEditor) {
+ viewer = ((JSPMultiPageEditor)editor).getJspEditor().getTextViewer();
+ } else if (editor instanceof XMLTextEditor) {
+ viewer = ((XMLTextEditor)editor).getTextViewer();
+ } else if (editor instanceof MultiPageEditorPart) {
+ IEditorPart activeEditor = getActiveEditor((MultiPageEditorPart)editor);
+ if (activeEditor instanceof AbstractTextEditor) {
+ viewer = getSourceViewer((AbstractTextEditor)activeEditor);
+ }
+ } else if (editor instanceof AbstractTextEditor ) {
+ viewer = getSourceViewer((AbstractTextEditor)editor);
+ }
+ else if (editor instanceof CompilationUnitEditor) {
+ viewer = ((CompilationUnitEditor)editor).getViewer();
+ }
+ return viewer;
+ }
+
+ /*
+ * Returns {@link ITextSelection} for a given viewer
+ *
+ * @param viewer
+ * @return
+ */
+ private ITextSelection getTextSelection(ITextViewer viewer) {
+ if (viewer == null || viewer.getSelectionProvider() == null)
+ return null;
+
+ return getTextSelection(viewer.getSelectionProvider().getSelection());
+ }
+
+ /*
+ * Returns {@link ITextSelection} for a given {@link ISelection}
+ *
+ * @param selection
+ * @return
+ */
+ private ITextSelection getTextSelection(ISelection selection) {
+ if (selection == null || selection.isEmpty())
+ return null;
+
+ if (selection instanceof ITextSelection) {
+ return (ITextSelection)selection;
+ }
+ return null;
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchPart activeWorkbenchPart = getCurrentEditor(getActiveWorkbenchWindow());
+ if (activeWorkbenchPart == null)
+ return null;
+
+ IEditorInput input = (activeWorkbenchPart instanceof IEditorPart ?
+ ((IEditorPart)activeWorkbenchPart).getEditorInput() : null);
+ ISourceViewer viewer = getEditorViewer(activeWorkbenchPart);
+ if (viewer == null)
+ return null;
+
+ ITextSelection selection = getTextSelection(viewer);
+ if (selection == null)
+ return null;
+
+ int selectionOffset = selection.getOffset();
+
+ IDocument document = viewer.getDocument();
+
+ IFile file = null;
+
+ if (input instanceof IFileEditorInput) {
+ file = ((IFileEditorInput)input).getFile();
+ }
+
+ IProject project = (file == null ? null : file.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return null;
+
+// List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(document, selectionOffset);
+
+ ELInvocationExpression tokens = null; //TODO
+
+ if (tokens == null)
+ return null; // No EL Operand found
+
+ try {
+ performNewSearch(tokens, file);
+ } catch (JavaModelException jme) {
+ SeamGuiPlugin.getPluginLog().logError(jme);
+ } catch (InterruptedException ie) {
+ SeamGuiPlugin.getPluginLog().logError(ie);
+ }
+ return null;
+
+ }
+ /**
+ * Finds the variable names for the selected ELOperandToken tokens
+ *
+ * @param seamProject
+ * @param document
+ * @param tokens
+ * @return
+ */
+ public static String[] findVariableNames(ISeamProject seamProject, IDocument document, ELInvocationExpression tokens) {
+ String[] varNames = null;
+ if(tokens == null) return varNames;
+
+ // Define the Seam project variables to search for declarations
+ List<ISeamContextVariable> variables = new ArrayList<ISeamContextVariable>();
+
+ while(tokens != null) {
+ try {
+ int start = tokens.getStartPosition();
+ int end = tokens.getEndPosition();
+ String variationText = document.get(start, end - start);
+
+ Set<ISeamContextVariable> vars = seamProject.getVariablesByName(variationText);
+ if (vars != null)
+ variables.addAll(vars);
+
+ } catch (BadLocationException e1) {
+ SeamGuiPlugin.getPluginLog().logError(e1);
+ }
+ tokens = tokens.getLeft();
+ }
+
+ if (variables.size() != 0) {
+ // Some variable/variables are found - perform search for their declarations
+ varNames = new String[variables.size()];
+ for (int i = 0; i < variables.size(); i++) {
+ varNames[i] = variables.get(i).getName();
+ }
+ }
+
+ return varNames;
+ }
+
+ /**
+ * @Override
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ selectionChanged(getCurrentEditor(getActiveWorkbenchWindow()), selection);
+ }
+ private SeamSearchQuery createQuery(ELInvocationExpression tokens, IFile sourceFile) throws JavaModelException, InterruptedException {
+
+ SeamSearchScope scope = new SeamSearchScope(new IProject[] {sourceFile.getProject()}, getLimitTo());
+
+ return new SeamSearchQuery(tokens, sourceFile, scope);
+ }
+
+ /**
+ * Returns the limitTo flag. The possible values are:
+ * - SeamSearchScope.SEARCH_FOR_DECLARATIONS
+ * - SeamSearchScope.SEARCH_FOR_REFERENCES
+ * @return
+ */
+ abstract protected int getLimitTo();
+
+ private void performNewSearch(ELInvocationExpression tokens, IFile sourceFile) throws JavaModelException, InterruptedException {
+ SeamSearchQuery query= createQuery(tokens, sourceFile);
+ if (query.canRunInBackground()) {
+ /*
+ * This indirection with Object as parameter is needed to prevent the loading
+ * of the Search plug-in: the VM verifies the method call and hence loads the
+ * types used in the method signature, eventually triggering the loading of
+ * a plug-in (in this case ISearchQuery results in Search plug-in being loaded).
+ */
+ SearchUtil.runQueryInBackground(query);
+ } else {
+ IProgressService progressService= PlatformUI.getWorkbench().getProgressService();
+ /*
+ * This indirection with Object as parameter is needed to prevent the loading
+ * of the Search plug-in: the VM verifies the method call and hence loads the
+ * types used in the method signature, eventually triggering the loading of
+ * a plug-in (in this case it would be ISearchQuery).
+ */
+ IStatus status= SearchUtil.runQueryInForeground(progressService, query);
+ if (status.matches(IStatus.ERROR | IStatus.INFO | IStatus.WARNING)) {
+ ErrorDialog.openError(getShell(), SearchMessages.Search_Error_search_title, SearchMessages.Search_Error_search_message, status);
+ }
+ }
+ }
+
+ /**
+ * Returns the active editor from active MultipageEditor
+ *
+ * @param multiPageEditor
+ * @return
+ */
+ public static IEditorPart getActiveEditor(MultiPageEditorPart multiPageEditor) {
+ Class editorClass = multiPageEditor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getActiveEditor", new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(multiPageEditor, new Object[]{});
+ return (result instanceof IEditorPart ? (IEditorPart)result : null);
+ }
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalArgumentException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ /**
+ * Returns the source viewer from AbstractTextEditor
+ *
+ * @param multiPageEditor
+ * @return
+ */
+ public static ISourceViewer getSourceViewer(AbstractTextEditor editor) {
+ Class editorClass = editor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getSourceViewer", new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(editor, new Object[]{});
+ return (result instanceof ISourceViewer ? (ISourceViewer)result : null);
+ }
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalArgumentException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ /*
+ * Returns current Shell
+ *
+ * @return
+ */
+ private Shell getShell() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
+// IWorkbenchPart fActiveWorkbenchPart = null;
+
+ /*
+ * Returns the workbench
+ *
+ * @return
+ */
+ private IWorkbench getWorkbench() {
+ return PlatformUI.getWorkbench();
+ }
+
+ /*
+ * Returns active workbench window
+ * @return
+ */
+ private IWorkbenchWindow getActiveWorkbenchWindow() {
+ return (getWorkbench() == null ? null : getWorkbench().getActiveWorkbenchWindow());
+ }
+
+ /*
+ * Updates availability on the action delegate
+ *
+ * @param selection
+ */
+ private void update(ISelection selection) {
+ boolean enabled = false;
+ try {
+ IWorkbenchPart activeWorkbenchPart = getCurrentEditor(getActiveWorkbenchWindow());
+ if (!(activeWorkbenchPart instanceof IEditorPart))
+ return;
+
+ ISourceViewer viewer = getEditorViewer((IEditorPart)activeWorkbenchPart);
+ if (viewer == null)
+ return;
+
+ enabled = (getTextSelection(selection) != null);
+ } finally {
+ setBaseEnabled(enabled);
+ }
+ }
+
+ // ISelectionListener
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ update(getTextSelection(getEditorViewer(part)));
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamReferencesHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamReferencesHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamReferencesHandler.java 2008-12-26 19:50:59 UTC (rev 12832)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.handlers;
+
+import org.jboss.tools.seam.ui.search.SeamSearchScope;
+
+
+public class FindSeamReferencesHandler extends FindSeamHandler{
+
+ /**
+ * Returns the search limitation to references
+ */
+ protected int getLimitTo() {
+ return SeamSearchScope.SEARCH_FOR_REFERENCES;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamReferencesHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/OpenSeamComponentHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/OpenSeamComponentHandler.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/OpenSeamComponentHandler.java 2008-12-26 19:50:59 UTC (rev 12832)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.handlers;
+
+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.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SelectionDialog;
+import org.jboss.tools.seam.core.ISeamComponentDeclaration;
+import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
+import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
+import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog.SeamComponentWrapper;
+/**
+ * @author Daniel Azarov
+ *
+ */
+public class OpenSeamComponentHandler extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Shell parent= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ SelectionDialog dialog;
+
+ dialog= new OpenSeamComponentDialog(parent);
+
+ dialog.setTitle(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME);
+ dialog.setMessage(SeamUIMessages.OPEN_SEAM_COMPONENT_ACTION_MESSAGE);
+
+ int result= dialog.open();
+ if (result != IDialogConstants.OK_ID)
+ return null;
+
+ Object[] components= dialog.getResult();
+ if (components != null && components.length > 0) {
+ SeamComponentWrapper wrapper= null;
+ for (int i= 0; i < components.length; i++) {
+ wrapper= (SeamComponentWrapper) components[i];
+ SeamJavaComponentDeclaration javaDeclaration = (SeamJavaComponentDeclaration)wrapper.getComponent().getJavaDeclaration();
+ if(javaDeclaration != null){
+ javaDeclaration.open();
+ }else{
+ Set<ISeamComponentDeclaration> declarations = wrapper.getComponent().getAllDeclarations();
+ if(declarations.iterator().hasNext()){
+ ((SeamComponentDeclaration)declarations.iterator().next()).open();
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/OpenSeamComponentHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years