JBoss Tools SVN: r18758 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-20 07:39:10 -0500 (Fri, 20 Nov 2009)
New Revision: 18758
Added:
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_ca_composite_component.png
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-909 Code assist for Composite components (JSF2) is implemented. JSF 2 Component is renamed to Composition Component - a section is added to vwt guide
Added: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_ca_composite_component.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_ca_composite_component.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-11-20 10:02:52 UTC (rev 18757)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-11-20 12:39:10 UTC (rev 18758)
@@ -266,14 +266,18 @@
<itemizedlist>
<listitem>
<para>Content Assist for XML, XHTML, JSP and JSF configuration files</para>
- </listitem>
+ </listitem>
<listitem>
+ <para>Content Assist for Composite Components</para>
+ </listitem>
+ <listitem>
<para>Content Assist based on project data</para>
</listitem>
<listitem>
<para>Content Assist with graphical JSF editor</para>
</listitem>
</itemizedlist>
+
<section id="ContentAssistForXMLJSPAndJSFConfigurationFiles865">
<title>Content Assist for XML, JSP and JSF configuration files</title>
@@ -313,7 +317,25 @@
</imageobject>
</mediaobject>
</figure>
- </section>
+ </section>
+
+ <section id="ContentAssistforCompositeComponents">
+ <title>Content Assist for Composite Components</title>
+ <para>Content assist functionality is also available for composite components. On the screen is shown content assist for a composite component file <property>"tag.xhtml"</property> within a JSF 1.2 project with facelets</para>
+
+ <figure>
+ <title>Content Assist in web.xml File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors_features/editors_features_ca_composite_component.png"
+ scale="85"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+
+
<section id="ContentAssistBasedOnProjectData86">
<title>Content Assist Based on Project Data</title>
15 years, 1 month
JBoss Tools SVN: r18757 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: mozilla and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-11-20 05:02:52 -0500 (Fri, 20 Nov 2009)
New Revision: 18757
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4998
Now Drag&Drop works for selected components.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-20 10:00:39 UTC (rev 18756)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-20 10:02:52 UTC (rev 18757)
@@ -1149,16 +1149,19 @@
// selection will be set only if press left button
if (mouseEvent.getButton() == LEFT_BUTTON) {
- selectionManager.setSelection(mouseEvent);
// drag gesture isn't generated in XR 1.9 for Linux Platforms,
// so we start it's manually
// mareshkau
nsIDOMElement selectedElement = getXulRunnerEditor()
.getLastSelectedElement();
- if (VpeVisualDomBuilder.inDragArea(XulRunnerVpeUtils
- .getElementBounds(selectedElement), VisualDomUtil
- .getMousePoint(mouseEvent))) {
+ if (selectedElement != null
+ && VpeVisualDomBuilder.inDragArea(
+ XulRunnerVpeUtils.getElementBounds(
+ selectedElement),
+ VisualDomUtil.getMousePoint(mouseEvent))) {
dragGesture(mouseEvent);
+ } else {
+ selectionManager.setSelection(mouseEvent);
}
}
} finally {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2009-11-20 10:00:39 UTC (rev 18756)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2009-11-20 10:02:52 UTC (rev 18757)
@@ -1209,65 +1209,74 @@
}
VpeVisualInnerDragInfo getInnerDragInfo(nsIDOMMouseEvent event) {
- nsISelection selection = visualSelectionController.getSelection(
- nsISelectionController.SELECTION_NORMAL);
- nsIDOMNode focusNode = selection.getFocusNode();
- nsIDOMNode anchorNode = selection.getAnchorNode();
- //when we select input this function return null
- //but we select elemnt
- if(focusNode==null && anchorNode==null) {
- nsIDOMNode visualNode =(nsIDOMNode) event.getTarget()
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- //fix of JBIDE-1097
- if(HTML.TAG_SPAN.equalsIgnoreCase(visualNode.getNodeName())) {
- if(visualBuilder.getXulRunnerEditor().getLastSelectedElement() != null
- && !visualBuilder.getNodeBounds(
- visualBuilder.getXulRunnerEditor()
- .getLastSelectedElement())
- .contains(VisualDomUtil.getMousePoint(event))) {
- return null;
- }
- }
- int offset = (int) VisualDomUtil.getOffset(visualNode);
- selection.removeAllRanges();
- selection.collapse(visualNode.getParentNode(), offset);
- try {
- selection.extend(visualNode.getParentNode(), offset + 1);
- } catch(XPCOMException ex) {
- //just ignore exception
- // throws when we trying drag element which already resizing
- return null;
- }
- focusNode = selection.getFocusNode();
- anchorNode = selection.getAnchorNode();
+ nsIDOMElement selectedElement
+ = visualBuilder.getXulRunnerEditor().getLastSelectedElement();
+ if (selectedElement == null) {
+ return null;
+ } else {
+ return new VpeVisualInnerDragInfo(selectedElement);
}
- if (focusNode != null && focusNode.equals(anchorNode)) {
- int focusOffset = selection.getFocusOffset();
- int anchorOffset = selection.getAnchorOffset();
- int offset = Math.min(focusOffset, anchorOffset);
- int length = Math.max(focusOffset, anchorOffset) - offset;
- int focusNodeType = focusNode.getNodeType();
- if (focusNodeType == nsIDOMNode.ELEMENT_NODE) {
- if (length == 1) {
- nsIDOMNodeList children = focusNode.getChildNodes();
- nsIDOMNode selectedNode = children.item(
- Math.min(focusOffset, anchorOffset));
- if (visualBuilder.getNodeBounds(selectedNode).contains(VisualDomUtil.getMousePoint(event))) {
- int selectedNodeType = selectedNode.getNodeType();
- if (selectedNodeType == nsIDOMNode.ELEMENT_NODE) {
- return new VpeVisualInnerDragInfo((nsIDOMElement)selectedNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
- } else if (selectedNodeType == nsIDOMNode.TEXT_NODE) {
- return new VpeVisualInnerDragInfo(selectedNode, 0, selectedNode.getNodeValue().length());
- }
- }
- }
- } else if (focusNodeType == nsIDOMNode.TEXT_NODE) {
- return new VpeVisualInnerDragInfo(focusNode, offset, length);
- }
- }
-
- return null;
+ // fix of JBIDE-4998
+// nsISelection selection = visualSelectionController.getSelection(
+// nsISelectionController.SELECTION_NORMAL);
+// nsIDOMNode focusNode = selection.getFocusNode();
+// nsIDOMNode anchorNode = selection.getAnchorNode();
+// //when we select input this function return null
+// //but we select elemnt
+// if(focusNode==null && anchorNode==null) {
+// nsIDOMNode visualNode =(nsIDOMNode) event.getTarget()
+// .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+// //fix of JBIDE-1097
+// if(HTML.TAG_SPAN.equalsIgnoreCase(visualNode.getNodeName())) {
+// if(visualBuilder.getXulRunnerEditor().getLastSelectedElement() != null
+// && !visualBuilder.getNodeBounds(
+// visualBuilder.getXulRunnerEditor()
+// .getLastSelectedElement())
+// .contains(VisualDomUtil.getMousePoint(event))) {
+// return null;
+// }
+// }
+// int offset = (int) VisualDomUtil.getOffset(visualNode);
+// selection.removeAllRanges();
+// selection.collapse(visualNode.getParentNode(), offset);
+// try {
+// selection.extend(visualNode.getParentNode(), offset + 1);
+// } catch(XPCOMException ex) {
+// //just ignore exception
+// // throws when we trying drag element which already resizing
+// return null;
+// }
+// focusNode = selection.getFocusNode();
+// anchorNode = selection.getAnchorNode();
+// }
+// if (focusNode != null && focusNode.equals(anchorNode)) {
+// int focusOffset = selection.getFocusOffset();
+// int anchorOffset = selection.getAnchorOffset();
+// int offset = Math.min(focusOffset, anchorOffset);
+// int length = Math.max(focusOffset, anchorOffset) - offset;
+//
+// int focusNodeType = focusNode.getNodeType();
+// if (focusNodeType == nsIDOMNode.ELEMENT_NODE) {
+// if (length == 1) {
+// nsIDOMNodeList children = focusNode.getChildNodes();
+// nsIDOMNode selectedNode = children.item(
+// Math.min(focusOffset, anchorOffset));
+// if (visualBuilder.getNodeBounds(selectedNode).contains(VisualDomUtil.getMousePoint(event))) {
+// int selectedNodeType = selectedNode.getNodeType();
+// if (selectedNodeType == nsIDOMNode.ELEMENT_NODE) {
+// return new VpeVisualInnerDragInfo((nsIDOMElement)selectedNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+// } else if (selectedNodeType == nsIDOMNode.TEXT_NODE) {
+// return new VpeVisualInnerDragInfo(selectedNode, 0, selectedNode.getNodeValue().length());
+// }
+// }
+// }
+// } else if (focusNodeType == nsIDOMNode.TEXT_NODE) {
+// return new VpeVisualInnerDragInfo(focusNode, offset, length);
+// }
+// }
+//
+// return null;
}
void setMouseUpSelection(nsIDOMMouseEvent mouseEvent) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2009-11-20 10:00:39 UTC (rev 18756)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2009-11-20 10:02:52 UTC (rev 18757)
@@ -156,9 +156,11 @@
//first param are null 0, because this not used in event handler
getEditorDomEventListener().onShowContextMenu(0, domEvent, (nsIDOMNode) domEvent.getTarget().queryInterface(nsIDOMNode.NS_IDOMNODE_IID));
} else if(DRAGGESTUREEVENT.equals(eventType)) {
- if(getEditorDomEventListener()!=null) {
- getEditorDomEventListener().dragGesture(domEvent);
- }
+ // fix of JBIDE-4998: since drag events now are implemented by
+ // handling CLICKEVENTTYPE, there is no need to handle them here
+ // if(getEditorDomEventListener()!=null) {
+ // getEditorDomEventListener().dragGesture(domEvent);
+ // }
} else if(DRAGDROPEVENT.equals(eventType)) {
// calls when drop event occure
getEditorDomEventListener().dragDrop(domEvent);
15 years, 1 month
JBoss Tools SVN: r18756 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-11-20 05:00:39 -0500 (Fri, 20 Nov 2009)
New Revision: 18756
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4998
minor fix: VpeSelectionBuilder.getInnerDragInfo has been refactored
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2009-11-19 18:33:57 UTC (rev 18755)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2009-11-20 10:00:39 UTC (rev 18756)
@@ -1209,20 +1209,22 @@
}
VpeVisualInnerDragInfo getInnerDragInfo(nsIDOMMouseEvent event) {
- VpeVisualInnerDragInfo info = null;
-
- nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
+ nsISelection selection = visualSelectionController.getSelection(
+ nsISelectionController.SELECTION_NORMAL);
nsIDOMNode focusNode = selection.getFocusNode();
nsIDOMNode anchorNode = selection.getAnchorNode();
//when we select input this function return null
//but we select elemnt
if(focusNode==null && anchorNode==null) {
-
- nsIDOMNode visualNode =(nsIDOMNode) event.getTarget().queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+ nsIDOMNode visualNode =(nsIDOMNode) event.getTarget()
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
//fix of JBIDE-1097
- if(HTML.TAG_SPAN.equalsIgnoreCase(visualNode.getNodeName()))
- {
- if(visualBuilder.getXulRunnerEditor().getLastSelectedElement()!=null&&!visualBuilder.getNodeBounds(visualBuilder.getXulRunnerEditor().getLastSelectedElement()).contains(VisualDomUtil.getMousePoint(event))){
+ if(HTML.TAG_SPAN.equalsIgnoreCase(visualNode.getNodeName())) {
+ if(visualBuilder.getXulRunnerEditor().getLastSelectedElement() != null
+ && !visualBuilder.getNodeBounds(
+ visualBuilder.getXulRunnerEditor()
+ .getLastSelectedElement())
+ .contains(VisualDomUtil.getMousePoint(event))) {
return null;
}
}
@@ -1230,7 +1232,7 @@
selection.removeAllRanges();
selection.collapse(visualNode.getParentNode(), offset);
try {
- selection.extend(visualNode.getParentNode(), offset + 1);
+ selection.extend(visualNode.getParentNode(), offset + 1);
} catch(XPCOMException ex) {
//just ignore exception
// throws when we trying drag element which already resizing
@@ -1245,29 +1247,27 @@
int offset = Math.min(focusOffset, anchorOffset);
int length = Math.max(focusOffset, anchorOffset) - offset;
- switch (focusNode.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE:
+ int focusNodeType = focusNode.getNodeType();
+ if (focusNodeType == nsIDOMNode.ELEMENT_NODE) {
if (length == 1) {
nsIDOMNodeList children = focusNode.getChildNodes();
- nsIDOMNode selectedNode = children.item(Math.min(focusOffset, anchorOffset));
+ nsIDOMNode selectedNode = children.item(
+ Math.min(focusOffset, anchorOffset));
if (visualBuilder.getNodeBounds(selectedNode).contains(VisualDomUtil.getMousePoint(event))) {
- switch(selectedNode.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE:
- info = new VpeVisualInnerDragInfo((nsIDOMElement)selectedNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
- break;
- case nsIDOMNode.TEXT_NODE:
- info = new VpeVisualInnerDragInfo(selectedNode, 0, selectedNode.getNodeValue().length());
- break;
+ int selectedNodeType = selectedNode.getNodeType();
+ if (selectedNodeType == nsIDOMNode.ELEMENT_NODE) {
+ return new VpeVisualInnerDragInfo((nsIDOMElement)selectedNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ } else if (selectedNodeType == nsIDOMNode.TEXT_NODE) {
+ return new VpeVisualInnerDragInfo(selectedNode, 0, selectedNode.getNodeValue().length());
}
}
}
- break;
- case nsIDOMNode.TEXT_NODE:
- info = new VpeVisualInnerDragInfo(focusNode, offset, length);
- break;
+ } else if (focusNodeType == nsIDOMNode.TEXT_NODE) {
+ return new VpeVisualInnerDragInfo(focusNode, offset, length);
}
}
- return info;
+
+ return null;
}
void setMouseUpSelection(nsIDOMMouseEvent mouseEvent) {
15 years, 1 month
JBoss Tools SVN: r18755 - trunk/as/plugins/org.jboss.ide.eclipse.as.ssh.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-19 13:33:57 -0500 (Thu, 19 Nov 2009)
New Revision: 18755
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
Log:
JBIDE-5187 - icon for runtime
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2009-11-19 18:24:45 UTC (rev 18754)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2009-11-19 18:33:57 UTC (rev 18755)
@@ -101,7 +101,7 @@
<image
icon="icons/ssh-16x16.png"
id="org.jboss.ide.eclipse.as.ssh.server.icons"
- typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType">
+ typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType,org.jboss.ide.eclipse.as.ssh.server.remoteServerRuntimeType">
</image>
</extension>
15 years, 1 month
JBoss Tools SVN: r18754 - in trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui: providers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-19 13:24:45 -0500 (Thu, 19 Nov 2009)
New Revision: 18754
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
Log:
JBIDE-5194
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2009-11-19 17:44:48 UTC (rev 18753)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2009-11-19 18:24:45 UTC (rev 18754)
@@ -69,6 +69,7 @@
public static String ProjectPackagesView_newPackageMenu_label;
public static String ProjectPackagesView_editFolderAction_label;
public static String ProjectPackagesView_deleteFolderAction_label;
+ public static String ProjectPackagesView_createFolderDialog_blank;
public static String ProjectPackagesView_editFilesetAction_label;
public static String ProjectPackagesView_deleteFilesetAction_label;
public static String ProjectPackagesView_buildArchiveAction_label;
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2009-11-19 17:44:48 UTC (rev 18753)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2009-11-19 18:24:45 UTC (rev 18754)
@@ -41,6 +41,7 @@
ProjectPackagesView_createFolderDialog_title=Create a folder
ProjectPackagesView_createFolderDialog_message=Name of the folder to create
ProjectPackagesView_createFolderDialog_warnFolderExists=The folder "{0}" already exists.
+ProjectPackagesView_createFolderDialog_blank=The folder name must not be empty.
FilesetInfoWizardPage_new_message=Create a new fileset consisting of one or more files
FilesetInfoWizardPage_new_title=New Fileset
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2009-11-19 17:44:48 UTC (rev 18753)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2009-11-19 18:24:45 UTC (rev 18754)
@@ -271,6 +271,9 @@
ArchivesUIMessages.ProjectPackagesView_createFolderDialog_warnFolderExists, newText);
}
+ if("".equals(newText)) { //$NON-NLS-1$
+ return ArchivesUIMessages.ProjectPackagesView_createFolderDialog_blank;
+ }
return null;
}
};
15 years, 1 month
JBoss Tools SVN: r18753 - in trunk: as/plugins/org.jboss.ide.eclipse.archives.webtools and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-11-19 12:44:48 -0500 (Thu, 19 Nov 2009)
New Revision: 18753
Added:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceFilter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClasspathFoldersVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFoldersVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/META-INF/MANIFEST.MF
Log:
JBIDE-4955 - adding fileset capability for workspace filesets
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -235,9 +235,9 @@
}
}
- public boolean couldBeIncluded(String name, boolean inWorkspace) {
+ public boolean couldBeIncluded(String path, boolean inWorkspace) {
IPath targetBase = ((FileWrapper)getBasedir()).getWrapperPath();
- IPath[] questionFiles = new IPath[] { new Path(name) };
+ IPath[] questionFiles = new IPath[] { new Path(path) };
if( workspaceRelative && !inWorkspace) {
questionFiles = ArchivesCore.getInstance().getVFS().absolutePathToWorkspacePath(questionFiles[0]);
} else if( !workspaceRelative && inWorkspace) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2009-11-19 17:44:48 UTC (rev 18753)
@@ -21,7 +21,11 @@
org.eclipse.core.filesystem;bundle-version="1.2.0",
org.eclipse.ui.navigator;bundle-version="3.3.100",
org.jboss.tools.jmx.core;bundle-version="0.2.1",
- org.eclipse.core.variables;bundle-version="3.2.200"
+ org.eclipse.core.variables;bundle-version="3.2.200",
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.wtp.ui;bundle-version="1.0.0",
+ org.eclipse.emf.common;bundle-version="2.5.0",
+ org.eclipse.emf.ecore;bundle-version="2.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.ide.eclipse.archives.webtools,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2009-11-19 17:44:48 UTC (rev 18753)
@@ -172,4 +172,21 @@
</page>
</extension>
+ <!-- Fileset integration for WTP Projects -->
+ <extension
+ point="org.jboss.ide.eclipse.as.wtp.core.referenceResolver">
+ <resolver
+ class="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver"
+ id="org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver">
+ </resolver>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.wtp.ui.referenceWizardFragment">
+ <referenceFragment
+ class="org.jboss.ide.eclipse.archives.webtools.ui.FilesetReferenceWizardFragment"
+ icon="icons/multiple_files.gif"
+ id="org.jboss.ide.eclipse.archives.webtools.FilesetReferenceWizardFragment"
+ name="Fileset">
+ </referenceFragment>
+ </extension>
</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -0,0 +1,97 @@
+package org.jboss.ide.eclipse.archives.webtools.filesets.vcf;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
+import org.eclipse.wst.common.componentcore.internal.DependencyType;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.jboss.ide.eclipse.as.wtp.core.vcf.IReferenceResolver;
+import org.jboss.ide.eclipse.as.wtp.core.vcf.OutputFoldersVirtualComponent;
+
+public class FilesetComponentResolver implements IReferenceResolver {
+ public static final String FILESET_SEGMENT = "org.jboss.ide.eclipse.archives.webtools.filesets.vcf.FilesetComponentResolver"; //$NON-NLS-1$
+ public static final String FILESET_PROTOCOL = PlatformURLModuleConnection.MODULE_PROTOCOL
+ +IPath.SEPARATOR+ FILESET_SEGMENT + IPath.SEPARATOR;
+ public boolean canResolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ URI handle = referencedComponent.getHandle();
+ String s = handle.toString();
+ if(s.startsWith(FILESET_PROTOCOL))
+ return true;
+ return false;
+ }
+
+ public boolean canResolve(IVirtualReference reference) {
+ IVirtualComponent vc = reference.getReferencedComponent();
+ if( vc instanceof WorkspaceFilesetVirtualComponent)
+ return true;
+ return false;
+ }
+
+ public IVirtualReference resolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ IProject p = context.getProject();
+ URI uri = referencedComponent.getHandle();
+ String main = uri.segment(1);
+ String[] split = main.split("&"); //$NON-NLS-1$
+ String path, includes, excludes;
+ path = includes = excludes = null;
+ try {
+ for( int i = 0; i < split.length; i++ ) {
+ boolean hasEquals = split[i].contains("="); //$NON-NLS-1$
+ String pre = split[i].substring(0, split[i].indexOf("=")); //$NON-NLS-1$
+ String post = split[i].substring(split[i].indexOf("=") + 1); //$NON-NLS-1$
+ post = URLDecoder.decode(post, "UTF-8"); //$NON-NLS-1$
+ if( "path".equals(pre)) //$NON-NLS-1$
+ path = post;
+ else if( "includes".equals(pre)) //$NON-NLS-1$
+ includes = post;
+ else if( "excludes".equals(pre)) //$NON-NLS-1$
+ excludes = post;
+ }
+ } catch( UnsupportedEncodingException uee) {}
+ WorkspaceFilesetVirtualComponent comp = new WorkspaceFilesetVirtualComponent(p, context, path);
+ comp.setIncludes(includes);
+ comp.setExcludes(excludes);
+ IVirtualReference ref = ComponentCore.createReference(context, comp);
+ ref.setArchiveName(referencedComponent.getArchiveName());
+ ref.setRuntimePath(referencedComponent.getRuntimePath());
+ ref.setDependencyType(referencedComponent.getDependencyType().getValue());
+ return ref;
+ }
+
+ public ReferencedComponent resolve(IVirtualReference reference) {
+ IVirtualComponent vc = reference.getReferencedComponent();
+ WorkspaceFilesetVirtualComponent fsvc = (WorkspaceFilesetVirtualComponent)vc;
+ String path = fsvc.getRootFolderPath();
+ String includes = fsvc.getIncludes();
+ String excludes = fsvc.getExcludes();
+ try {
+ String url = "path=" + URLEncoder.encode(path, "UTF-8"); //$NON-NLS-1$//$NON-NLS-2$
+ url += "&includes=" + URLEncoder.encode(includes, "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
+ url += "&excludes=" + URLEncoder.encode(excludes, "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ReferencedComponent rc = ComponentcorePackage.eINSTANCE.getComponentcoreFactory().createReferencedComponent();
+ rc.setArchiveName(reference.getArchiveName());
+ rc.setRuntimePath(reference.getRuntimePath());
+ String tmp = fsvc.getId();
+ rc.setHandle(URI.createURI(fsvc.getId() + url));
+ rc.setDependencyType(DependencyType.CONSUMES_LITERAL);
+ return rc;
+
+ } catch( UnsupportedEncodingException uee) {}
+ int x = 5;
+ return null;
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -0,0 +1,97 @@
+package org.jboss.ide.eclipse.archives.webtools.filesets.vcf;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelRootNode;
+import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension;
+import org.jboss.ide.eclipse.as.wtp.core.util.ResourceFilter;
+import org.jboss.ide.eclipse.as.wtp.core.util.ResourceListVirtualFolder;
+import org.jboss.ide.eclipse.as.wtp.core.vcf.AbstractFilesetVirtualComponent;
+
+public class WorkspaceFilesetVirtualComponent extends AbstractFilesetVirtualComponent {
+ private String rootFolderPath, includes, excludes;
+ public WorkspaceFilesetVirtualComponent(IProject p,
+ IVirtualComponent referencingComponent, String rootPath) {
+ super(p, referencingComponent);
+ this.rootFolderPath = rootPath;
+ includes = "**"; //$NON-NLS-1$
+ excludes = ""; //$NON-NLS-1$
+ }
+
+ protected String getFirstIdSegment() {
+ return FilesetComponentResolver.FILESET_PROTOCOL;
+ }
+
+ @Override
+ public String getId() {
+ return getFirstIdSegment();
+ }
+
+ public IVirtualFolder getRootFolder() {
+ ResourceListVirtualFolder folder = (ResourceListVirtualFolder)super.getRootFolder();
+ folder.setFilter(new WorkspaceFilter());
+ return folder;
+ }
+
+
+ protected IResource[] getLooseResources() {
+ return new IResource[]{};
+ }
+
+ protected IContainer[] getUnderlyingContainers() {
+ if( rootFolderPath != null ) {
+ IPath p = new Path(rootFolderPath);
+ IContainer c = p.segmentCount() > 1 ?
+ ResourcesPlugin.getWorkspace().getRoot().getFolder(p)
+ : ResourcesPlugin.getWorkspace().getRoot().getProject(p.segment(0));
+ return new IContainer[] { c };
+ }
+ return new IContainer[] { };
+ }
+
+ public void setRootFolderPath(String rootFolder) {
+ this.rootFolderPath = rootFolder;
+ }
+
+ public String getRootFolderPath() {
+ return rootFolderPath;
+ }
+
+ public void setIncludes(String includes) {
+ this.includes = includes;
+ }
+
+ public String getIncludes() {
+ return includes;
+ }
+
+ public void setExcludes(String excludes) {
+ this.excludes = excludes;
+ }
+
+ public String getExcludes() {
+ return excludes;
+ }
+
+ public class WorkspaceFilter implements ResourceFilter {
+ private DirectoryScannerExtension scanner;
+ public WorkspaceFilter() {
+ scanner = DirectoryScannerFactory.createDirectoryScanner(
+ rootFolderPath, new Path(""), //$NON-NLS-1$
+ includes, excludes, getProject().getName(), true,
+ IArchiveModelRootNode.DESCRIPTOR_VERSION_1_3, false);
+ }
+ public boolean accepts(IResource resource) {
+ boolean b = scanner.couldBeIncluded(resource.getFullPath().toString(), true);
+ return b;
+ }
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -0,0 +1,146 @@
+package org.jboss.ide.eclipse.archives.webtools.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.wst.common.componentcore.internal.DependencyType;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.jboss.ide.eclipse.archives.webtools.filesets.vcf.WorkspaceFilesetVirtualComponent;
+import org.jboss.ide.eclipse.as.wtp.ui.propertypage.NewReferenceWizard;
+
+public class FilesetReferenceWizardFragment extends WizardFragment {
+ public boolean hasComposite() {
+ return true;
+ }
+
+ private boolean hasEntered = false;
+ public boolean isComplete() {
+ return hasEntered;
+ }
+
+ private Text incText, excText, rootText;
+ private String includes, excludes, folder;
+ public Composite createComposite(Composite parent, IWizardHandle handle) {
+ hasEntered = true;
+ handle.setTitle("Add a fileset"); //$NON-NLS-1$
+ handle.setDescription("This will let you select a root folder and some matching patterns"); //$NON-NLS-1$
+
+ Composite child = new Composite(parent, SWT.NONE);
+
+ // root folder, text, browse
+ child.setLayout(new FormLayout());
+ Control top = null;
+ addLabel("Root Folder", child, top); //$NON-NLS-1$
+ top = rootText = addText(child, top, true);
+ addLabel("Includes", child, top); //$NON-NLS-1$
+ top = incText = addText(child, top, false);
+ addLabel("Excludes", child, top); //$NON-NLS-1$
+ top = excText = addText(child, top, false);
+ ModifyListener listener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ textModified();
+ }
+ };
+ IProject p = (IProject)getTaskModel().getObject(NewReferenceWizard.PROJECT);
+ rootText.setText(p.getFullPath().toString());
+ incText.setText("**"); //$NON-NLS-1$
+ rootText.addModifyListener(listener);
+ incText.addModifyListener(listener);
+ excText.addModifyListener(listener);
+ textModified();
+ return child;
+ }
+
+ protected void textModified() {
+ includes = incText.getText();
+ excludes = excText.getText();
+ folder = rootText.getText();
+ }
+
+ protected Text addText(Composite parent, Control top, boolean includeBrowse) {
+ Text t = new Text(parent, SWT.BORDER);
+ Button b = null;
+ if( includeBrowse ) {
+ b = new Button(parent, SWT.NONE);
+ b.setText("Browse..."); //$NON-NLS-1$
+ addBrowseListener(b,t);
+ FormData bData = new FormData();
+ bData.right = new FormAttachment(100,-5);
+ bData.top = top == null ? new FormAttachment(0, 5) : new FormAttachment(top, 5);
+ b.setLayoutData(bData);
+ }
+ FormData fd = new FormData();
+ fd.top = top == null ? new FormAttachment(0,5) : new FormAttachment(top, 5);
+ fd.left = new FormAttachment(25, 0);
+ fd.right = b == null ? new FormAttachment(100, -5) : new FormAttachment(b, -5);
+ t.setLayoutData(fd);
+ return t;
+ }
+
+ protected void addBrowseListener(final Button b, final Text t) {
+ b.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ browsePressed(b, t);
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+ protected void browsePressed(Button b, Text t) {
+ // show the dialog, then set the proper text
+ ContainerSelectionDialog d = new ContainerSelectionDialog(b.getShell(), null,
+ false, "Please select a root folder"); //$NON-NLS-1$
+ if(d.open() == Dialog.OK) {
+ Object[] o = d.getResult();
+ if( o != null && o.length > 0) {
+ IPath path = (IPath)o[0];
+ t.setText(path.toString());
+ }
+ }
+ }
+
+ protected Label addLabel(String text, Composite parent, Control top) {
+ Label l = new Label(parent, SWT.NONE);
+ l.setText(text);
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(0, 5);
+ fd.top = top == null ? new FormAttachment(0,5) : new FormAttachment(top, 5);
+ l.setLayoutData(fd);
+ return l;
+ }
+
+ public void performFinish(IProgressMonitor monitor) throws CoreException {
+ getTaskModel().putObject(NewReferenceWizard.COMPONENT, getFilesetComponent());
+ getTaskModel().putObject(NewReferenceWizard.COMPONENT_PATH, "/"); //$NON-NLS-1$
+ getTaskModel().putObject(NewReferenceWizard.DEPENDENCY_TYPE, DependencyType.CONSUMES_LITERAL);
+ }
+
+ protected IVirtualComponent getFilesetComponent() {
+ IVirtualComponent root = (IVirtualComponent)getTaskModel().getObject(NewReferenceWizard.ROOT_COMPONENT);
+ WorkspaceFilesetVirtualComponent vc = new WorkspaceFilesetVirtualComponent(
+ root.getProject(), root, new Path(folder).makeAbsolute().toString());
+ vc.setIncludes(includes);
+ vc.setExcludes(excludes);
+ return vc;
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceFilter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceFilter.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceFilter.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -0,0 +1,7 @@
+package org.jboss.ide.eclipse.as.wtp.core.util;
+
+import org.eclipse.core.resources.IResource;
+
+public interface ResourceFilter {
+ public boolean accepts(IResource resource);
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/util/ResourceListVirtualFolder.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.core.util;
+import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -30,6 +31,7 @@
private ArrayList<IResource> children;
private ArrayList<IContainer> underlying;
+ private ResourceFilter filter;
public ResourceListVirtualFolder(
IProject aComponentProject,
IPath aRuntimePath) {
@@ -53,6 +55,10 @@
addChildren(looseResources);
}
+ public void setFilter(ResourceFilter filter) {
+ this.filter = filter;
+ }
+
protected void addUnderlyingResource(IResource resource) {
if( resource instanceof IContainer ) {
underlying.add((IContainer)resource);
@@ -97,7 +103,6 @@
public IContainer[] getUnderlyingFolders() {
return (IContainer[]) underlying.toArray(new IContainer[underlying.size()]);
}
-
public IVirtualResource[] members(int memberFlags) throws CoreException {
HashMap<String, IVirtualResource> virtualResources = new HashMap<String, IVirtualResource>(); // result
@@ -110,6 +115,9 @@
}
protected void handleResource(IResource resource, HashMap<String, IVirtualResource> map, int memberFlags) throws CoreException {
+ if( filter != null && !filter.accepts(resource))
+ return;
+
if( resource instanceof IFile ) {
if( !map.containsKey(resource.getName()) ) {
IVirtualFile virtFile = new VirtualFile(getProject(),
@@ -128,6 +136,8 @@
ResourceListVirtualFolder childFolder =
new ResourceListVirtualFolder(getProject(), getRuntimePath().append(resource.getName()));
childFolder.addUnderlyingResource(realContainer);
+ if( filter != null )
+ childFolder.setFilter(filter);
map.put(resource.getName(), childFolder);
}
} // end container
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java (from rev 18393, trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/AbstractFilesetVirtualComponent.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.ide.eclipse.as.wtp.core.vcf;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.jboss.ide.eclipse.as.wtp.core.util.ResourceListVirtualFolder;
+
+public abstract class AbstractFilesetVirtualComponent implements IVirtualComponent {
+ protected IProject project;
+ protected IVirtualComponent referencingComp;
+
+ public AbstractFilesetVirtualComponent(IProject p, IVirtualComponent referencingComponent) {
+ this.project = p;
+ this.referencingComp = referencingComponent;
+ }
+
+ public void create(int updateFlags, IProgressMonitor aMonitor)
+ throws CoreException {
+ // Ignore
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public IVirtualComponent getComponent() {
+ return this;
+ }
+
+ public String getName() {
+ return getId();
+ }
+
+ public String getDeployedName() {
+ return getName();
+ }
+
+ public String getId() {
+ String firstSegment = getFirstIdSegment();
+ if (project != null && project.equals(
+ referencingComp.getProject()))
+ return firstSegment;
+ return firstSegment + Path.SEPARATOR + project.getName();
+ }
+
+ protected abstract String getFirstIdSegment();
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public IVirtualComponent[] getReferencingComponents() {
+ return referencingComp == null ? new IVirtualComponent[] {}
+ : new IVirtualComponent[] { referencingComp };
+ }
+
+ public IVirtualFolder getRootFolder() {
+ // Creates a new instance each time to ensure it's not cached
+ IContainer[] containers = getUnderlyingContainers();
+ IResource[] looseResources = getLooseResources();
+ ResourceListVirtualFolder folder =
+ new ResourceListVirtualFolder(project, new Path("/"), containers, looseResources);
+ return folder;
+ }
+
+ protected abstract IContainer[] getUnderlyingContainers();
+ protected abstract IResource[] getLooseResources();
+
+ public Properties getMetaProperties() {
+ return null;
+ }
+
+ public IPath[] getMetaResources() {
+ return null;
+ }
+
+ public IVirtualReference getReference(String aComponentName) {
+ // Ignore
+ return null;
+ }
+
+ public IVirtualReference[] getReferences() {
+ // Ignore; no children
+ return new IVirtualReference[] {};
+ }
+
+ public boolean isBinary() {
+ return false;
+ }
+
+ public void setMetaProperties(Properties properties) {
+ // Ignore
+ }
+
+ public void setMetaProperty(String name, String value) {
+ // Ignore
+ }
+
+ public void setMetaResources(IPath[] theMetaResourcePaths) {
+ // Ignore
+ }
+
+ public void setReferences(IVirtualReference[] theReferences) {
+ // Ignore
+ }
+
+ public Object getAdapter(Class adapter) {
+ // Ignore
+ return null;
+ }
+
+ public void addReferences(IVirtualReference[] references) {
+ // Ignore
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClasspathFoldersVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClasspathFoldersVirtualComponent.java 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/ExportedClasspathFoldersVirtualComponent.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -25,7 +25,7 @@
import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-public class ExportedClasspathFoldersVirtualComponent extends FilesetVirtualComponent {
+public class ExportedClasspathFoldersVirtualComponent extends AbstractFilesetVirtualComponent {
public ExportedClasspathFoldersVirtualComponent(IProject p, IVirtualComponent referencingComponent) {
super(p,referencingComponent);
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/FilesetVirtualComponent.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.ide.eclipse.as.wtp.core.vcf;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.jboss.ide.eclipse.as.wtp.core.util.ResourceListVirtualFolder;
-
-public abstract class FilesetVirtualComponent implements IVirtualComponent {
- protected IProject project;
- protected IVirtualComponent referencingComp;
-
- public FilesetVirtualComponent(IProject p, IVirtualComponent referencingComponent) {
- this.project = p;
- this.referencingComp = referencingComponent;
- }
-
- public void create(int updateFlags, IProgressMonitor aMonitor)
- throws CoreException {
- // Ignore
- }
-
- public boolean exists() {
- return true;
- }
-
- public IVirtualComponent getComponent() {
- return this;
- }
-
- public String getName() {
- return getId();
- }
-
- public String getDeployedName() {
- return getName();
- }
-
- protected String getId() {
- String firstSegment = getFirstIdSegment();
- if (project.equals(referencingComp.getProject()))
- return firstSegment;
- return firstSegment + Path.SEPARATOR + project.getName();
- }
-
- protected abstract String getFirstIdSegment();
-
- public IProject getProject() {
- return project;
- }
-
- public IVirtualComponent[] getReferencingComponents() {
- return referencingComp == null ? new IVirtualComponent[] {}
- : new IVirtualComponent[] { referencingComp };
- }
-
- public IVirtualFolder getRootFolder() {
- // Creates a new instance each time to ensure it's not cached
- IContainer[] containers = getUnderlyingContainers();
- IResource[] looseResources = getLooseResources();
- ResourceListVirtualFolder folder =
- new ResourceListVirtualFolder(project, new Path("/"), containers, looseResources);
- return folder;
- }
-
- protected abstract IContainer[] getUnderlyingContainers();
- protected abstract IResource[] getLooseResources();
-
- public Properties getMetaProperties() {
- return null;
- }
-
- public IPath[] getMetaResources() {
- return null;
- }
-
- public IVirtualReference getReference(String aComponentName) {
- // Ignore
- return null;
- }
-
- public IVirtualReference[] getReferences() {
- // Ignore; no children
- return new IVirtualReference[] {};
- }
-
- public boolean isBinary() {
- return false;
- }
-
- public void setMetaProperties(Properties properties) {
- // Ignore
- }
-
- public void setMetaProperty(String name, String value) {
- // Ignore
- }
-
- public void setMetaResources(IPath[] theMetaResourcePaths) {
- // Ignore
- }
-
- public void setReferences(IVirtualReference[] theReferences) {
- // Ignore
- }
-
- public Object getAdapter(Class adapter) {
- // Ignore
- return null;
- }
-
- public void addReferences(IVirtualReference[] references) {
- // Ignore
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFoldersVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFoldersVirtualComponent.java 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.core/src/org/jboss/ide/eclipse/as/wtp/core/vcf/OutputFoldersVirtualComponent.java 2009-11-19 17:44:48 UTC (rev 18753)
@@ -23,7 +23,7 @@
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-public class OutputFoldersVirtualComponent extends FilesetVirtualComponent {
+public class OutputFoldersVirtualComponent extends AbstractFilesetVirtualComponent {
public OutputFoldersVirtualComponent(IProject p, IVirtualComponent referencingComponent) {
super(p, referencingComponent);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/META-INF/MANIFEST.MF 2009-11-19 17:21:15 UTC (rev 18752)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/META-INF/MANIFEST.MF 2009-11-19 17:44:48 UTC (rev 18753)
@@ -29,3 +29,4 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: JBoss by Red Hat
+Export-Package: org.jboss.ide.eclipse.as.wtp.ui.propertypage
15 years, 1 month
JBoss Tools SVN: r18752 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui: src/org/jboss/tools/hibernate/ui/diagram/editors/actions and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-11-19 12:21:15 -0500 (Thu, 19 Nov 2009)
New Revision: 18752
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5147 & https://jira.jboss.org/jira/browse/JBIDE-5148 - fix server build
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2009-11-19 16:47:45 UTC (rev 18751)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2009-11-19 17:21:15 UTC (rev 18752)
@@ -16,9 +16,6 @@
org.hibernate.eclipse,
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.gmf.runtime.diagram.ui.printing,
- org.eclipse.gmf.runtime.draw2d.ui.render,
org.hibernate.eclipse.console
Bundle-Version: 3.3.0.qualifier
Export-Package: org.jboss.tools.hibernate.ui.diagram,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java 2009-11-19 16:47:45 UTC (rev 18751)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/PrintPreViewDiagramViewerAction.java 2009-11-19 17:21:15 UTC (rev 18752)
@@ -13,7 +13,7 @@
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.gmf.runtime.common.ui.action.actions.IPrintActionHelper;
+//import org.eclipse.gmf.runtime.common.ui.action.actions.IPrintActionHelper;
/**
* Initial test implementation for Print preview for Mapping Diagram
@@ -24,11 +24,11 @@
private org.jboss.tools.hibernate.ui.diagram.editors.print.PrintPreviewHelper
printPreviewHelper = new org.jboss.tools.hibernate.ui.diagram.editors.print.PrintPreviewHelper();
- private IPrintActionHelper helper = null;
+// private IPrintActionHelper helper = null;
//new org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.EnhancedPrintActionHelper();
public Object execute(ExecutionEvent event) throws ExecutionException {
- printPreviewHelper.doPrintPreview(helper);
+// printPreviewHelper.doPrintPreview(helper);
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java 2009-11-19 16:47:45 UTC (rev 18751)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/print/PrintPreviewHelper.java 2009-11-19 17:21:15 UTC (rev 18752)
@@ -11,6 +11,7 @@
import org.eclipse.draw2d.SWTGraphics;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.LayerConstants;
+/** /
import org.eclipse.gmf.runtime.common.ui.action.actions.IPrintActionHelper;
import org.eclipse.gmf.runtime.common.ui.util.WindowUtil;
import org.eclipse.gmf.runtime.diagram.ui.internal.pagesetup.PageInfoHelper.PageMargins;
@@ -24,6 +25,7 @@
import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics;
import org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedScaledGraphics;
+/**/
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
@@ -61,7 +63,7 @@
* Action helper for print. This must be passed in to have something happen
* when print is pressed
*/
- protected IPrintActionHelper printActionHelper;
+// protected IPrintActionHelper printActionHelper;
/**
* Increment userX everytime the user moves right, decrement userX everytime
@@ -268,6 +270,7 @@
/**
* Initialize all toolbar images
*/
+ /** /
protected void initializeToolbarImages() {
printImage = DiagramUIPrintingPluginImages.DESC_PRINT.createImage();
@@ -737,12 +740,10 @@
diagramEditPart = getDiagramEditorPart().getDiagramEditPart();
}
if (diagramEditPart == null) {
- /** /
- Diagram diagram = getDiagramEditorPart().getDiagram(); //do not getDiagramEditPart
- PreferencesHint preferencesHint = getPreferencesHint(getDiagramEditorPart());
- diagramEditPart = PrintHelperUtil.createDiagramEditPart(diagram, preferencesHint, getTempShell());
- PrintHelperUtil.initializePreferences(diagramEditPart, preferencesHint);
- /**/
+ //Diagram diagram = getDiagramEditorPart().getDiagram(); //do not getDiagramEditPart
+ //PreferencesHint preferencesHint = getPreferencesHint(getDiagramEditorPart());
+ //diagramEditPart = PrintHelperUtil.createDiagramEditPart(diagram, preferencesHint, getTempShell());
+ //PrintHelperUtil.initializePreferences(diagramEditPart, preferencesHint);
}
return diagramEditPart;
}
@@ -981,14 +982,12 @@
g.scale(scale);
//vit
- /** /
- String headerOrFooter =
- HeaderAndFooterHelper.makeHeaderOrFooterString(
- WorkspaceViewerProperties.HEADER_PREFIX,
- 1 + userY + row,
- 1 + userX + col,
- getDiagramEditPart());
- /**/
+ //String headerOrFooter =
+ // HeaderAndFooterHelper.makeHeaderOrFooterString(
+ // WorkspaceViewerProperties.HEADER_PREFIX,
+ // 1 + userY + row,
+ // 1 + userX + col,
+ // getDiagramEditPart());
String headerOrFooter = "headerOrFooter";
g.drawText(
@@ -997,14 +996,12 @@
getMapMode().DPtoLP(HeaderAndFooterHelper.TOP_MARGIN_DP));
//vit
- /** /
- headerOrFooter =
- HeaderAndFooterHelper.makeHeaderOrFooterString(
- WorkspaceViewerProperties.FOOTER_PREFIX,
- 1 + userY + row,
- 1 + userX + col,
- getDiagramEditPart());
- /**/
+ //headerOrFooter =
+ // HeaderAndFooterHelper.makeHeaderOrFooterString(
+ // WorkspaceViewerProperties.FOOTER_PREFIX,
+ // 1 + userY + row,
+ // 1 + userX + col,
+ // getDiagramEditPart());
headerOrFooter = "headerOrFooter";
g.drawText(
@@ -1079,4 +1076,5 @@
public void setPercentScaling(int userScale){
setUserScale(userScale);
}
+ /**/
}
15 years, 1 month
JBoss Tools SVN: r18751 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-11-19 11:47:45 -0500 (Thu, 19 Nov 2009)
New Revision: 18751
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
Log:
https://jira.jboss.org/jira/browse/jbide-5131 - fix for the first clause
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-11-19 16:46:29 UTC (rev 18750)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-11-19 16:47:45 UTC (rev 18751)
@@ -609,6 +609,9 @@
KeyStroke.getPressed('+', SWT.KEYPAD_ADD, 0),
getActionRegistry().getAction(ToggleShapeVisibleStateAction.ACTION_ID));
sharedKeyHandler.put(
+ KeyStroke.getPressed('=', '=', 0),
+ getActionRegistry().getAction(ToggleShapeVisibleStateAction.ACTION_ID));
+ sharedKeyHandler.put(
KeyStroke.getReleased(' ', Action.findKeyCode("SPACE"), 0), //$NON-NLS-1$
getActionRegistry().getAction(LexicalSortingAction.ACTION_ID));
}
15 years, 1 month
JBoss Tools SVN: r18750 - in trunk/esb/plugins/org.jboss.tools.esb.core: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-19 11:46:29 -0500 (Thu, 19 Nov 2009)
New Revision: 18750
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5191
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-11-19 16:37:19 UTC (rev 18749)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-11-19 16:46:29 UTC (rev 18750)
@@ -38,6 +38,8 @@
<xclass id="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
class="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"/>
+ <xclass id="org.jboss.tools.esb.core.model.ESBResourceTree"
+ class="org.jboss.tools.esb.core.model.ESBResourceTree"/>
</extension>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-19 16:37:19 UTC (rev 18749)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-19 16:46:29 UTC (rev 18750)
@@ -37,7 +37,7 @@
</MAPPING>
<MAPPING name="FilteredTreeConstraints"/>
<MAPPING name="FilteredTrees">
- <PAIR name="ESBResourceTree" value="org.jboss.tools.jst.web.model.tree.WebPagesTree"/>
+ <PAIR name="ESBResourceTree" value="org.jboss.tools.esb.core.model.ESBResourceTree"/>
</MAPPING>
<MAPPING name="Handlers"/>
<MAPPING name="Implementations">
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java 2009-11-19 16:46:29 UTC (rev 18750)
@@ -0,0 +1,88 @@
+package org.jboss.tools.esb.core.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.XFileObject;
+import org.jboss.tools.common.model.impl.trees.FileSystemResourceTree;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+
+public class ESBResourceTree extends FileSystemResourceTree {
+
+ public XModelObject[] getChildren(XModelObject object) {
+ if(object == getRoot()) {
+ XModelObject[] os = object.getChildren();
+ List<XModelObject> list = new ArrayList<XModelObject>();
+ XModelObject r = FileSystemsHelper.getWebRoot(model);
+ list.add(r);
+ for (int i = 0; i < os.length; i++) {
+ String name = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ if(name.startsWith("src")) {
+ list.add(os[i]);
+ }
+ }
+ for (int i = 0; i < os.length; i++) {
+ String name = os[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ if(name.startsWith("lib-")) {
+ list.add(os[i]);
+ }
+ }
+ return list.toArray(new XModelObject[0]);
+ }
+
+ if(!hasChildren(object)) return new XModelObject[0];
+ List<XModelObject> l = new ArrayList<XModelObject>();
+ XModelObject[] cs = object.getChildren();
+ for (int i = 0; i < cs.length; i++) if(accept(cs[i])) l.add(cs[i]);
+ return l.toArray(new XModelObject[0]);
+ }
+
+ public XModelObject getParent(XModelObject object) {
+ return object.getParent();
+ }
+
+ private boolean accept(XModelObject c) {
+ if(c.getFileType() == XFileObject.FOLDER) {
+ String overlapped = c.get("overlapped"); //$NON-NLS-1$
+ if(overlapped != null && overlapped.length() > 0) {
+ String overlappedSystem = c.get("overlappedSystem"); //$NON-NLS-1$
+ if(!"FileSystems/WEB-INF".equals(overlappedSystem)) return false; //$NON-NLS-1$
+ }
+ } else if(c.getFileType() == XFileObject.FILE) {
+ String nm = c.getAttributeValue("name"); //$NON-NLS-1$
+ if(nm.length() == 0) return false;
+ if(!accepts0(c)) return false;
+ }
+ return true;
+ }
+
+ public boolean isSelectable(XModelObject object) {
+ return (object != null && (object.getFileType() == XFileObject.FILE || object.getFileType() == XFileObject.FOLDER));
+ }
+
+ public String getPath(XModelObject o) {
+ if(o == null || o.getFileType() == XModelObject.SYSTEM) return ""; //$NON-NLS-1$
+ String s = XModelObjectLoaderUtil.getResourcePath(o);
+ String p = o.getPath();
+ if(p == null) return ""; //$NON-NLS-1$
+ int b = "FileSystems/".length(), e = p.length() - s.length(); //$NON-NLS-1$
+ if(e < b) return ""; //$NON-NLS-1$
+ if(o.getFileType() == XFileObject.FOLDER) s += "/"; //$NON-NLS-1$
+ return s;
+ }
+
+ public XModelObject find(String value) {
+ if(value != null && value.endsWith("/")) {
+ value = value.substring(0, value.length() - 1);
+ }
+ XModelObject result = model.getByPath(value);
+ if(result == null && value != null && !value.startsWith("/")) { //$NON-NLS-1$
+ result = model.getByPath("/" + value); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBResourceTree.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss Tools SVN: r18749 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-19 11:37:19 -0500 (Thu, 19 Nov 2009)
New Revision: 18749
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java
Log:
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java 2009-11-19 16:15:17 UTC (rev 18748)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/OpenEditorWizard.java 2009-11-19 16:37:19 UTC (rev 18749)
@@ -86,6 +86,11 @@
editor = IDE.openEditor(workbenchPage, f, true);
}
} else {
+ if(id == null) {
+ IEditorDescriptor d = IDE.getEditorDescriptor(input.getName());
+ if(d != null) id = d.getId();
+ if(id == null) id = "org.eclipse.ui.DefaultTextEditor";
+ }
editor = workbenchPage.openEditor(input, id);
}
} else {
15 years, 1 month