Author: dazarov
Date: 2008-02-12 11:43:51 -0500 (Tue, 12 Feb 2008)
New Revision: 6271
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_component.gif
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-518
Copied: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_component.gif (from rev
6259, trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif)
===================================================================
(Binary files differ)
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_component.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/open_seam_project.gif
===================================================================
(Binary files differ)
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-02-12 15:40:59 UTC (rev
6270)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-02-12 16:43:51 UTC (rev
6271)
@@ -429,7 +429,7 @@
class="org.jboss.tools.seam.ui.actions.OpenSeamComponentAction"
definitionId="org.jboss.tools.seam.ui.open.component"
helpContextId="org.eclipse.jdt.ui.open_type_action"
- icon="icons/open_seam_project.gif"
+ icon="icons/open_seam_component.gif"
id="openComponent"
label="Open Seam Component"
menubarPath="navigate/open.ext2"
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-02-12
15:40:59 UTC (rev 6270)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-02-12
16:43:51 UTC (rev 6271)
@@ -199,6 +199,6 @@
OPEN_SEAM_COMPONENT_ACTION_ACTION_NAME=Open Seam Component
OPEN_SEAM_COMPONENT_ACTION_DESCRIPTION=Open Seam Component
OPEN_SEAM_COMPONENT_ACTION_TOOL_TIP=Open Seam Component
-OPEN_SEAM_COMPONENT_ACTION_MESSAGE=&Choose a name of the seam component (? = any
character, * = any string):
+OPEN_SEAM_COMPONENT_ACTION_MESSAGE=&Choose a name of the seam component or pattern (?
= any character, * = any string):
OPEN_SEAM_COMPONENT_DIALOG_LOADING=Seam components loading
OPEN_SEAM_COMPONENT_DIALOG_NAME=OpenSeamComponentDialog
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-02-12
15:40:59 UTC (rev 6270)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-02-12
16:43:51 UTC (rev 6271)
@@ -28,6 +28,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMemento;
+import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
@@ -45,15 +46,11 @@
public OpenSeamComponentDialog(Shell shell) {
super(shell);
+ setSelectionHistory(new SeamComponentSelectionHistory());
setListLabelProvider(new SeamComponentLabelProvider());
setDetailsLabelProvider(new SeamComponentLabelProvider());
- setSelectionHistory(new SeamComponentSelectionHistory());
}
- protected void computeResult() {
- super.computeResult();
- }
-
protected Control createExtendedContentArea(Composite parent) {
return null;
}
@@ -159,6 +156,8 @@
}
public boolean isOK() {
+ if(getSelectedItems().size() < 0) return false;
+
return true;
}
@@ -169,12 +168,32 @@
}
public class SeamComponentSelectionHistory extends SelectionHistory{
+ public SeamComponentSelectionHistory(){
+ super();
+ }
+
protected Object restoreItemFromMemento(IMemento memento) {
- return null;
+ System.out.println("restoreItemFromMemento memento - "+memento.getClass());
+ XMLMemento mem = (XMLMemento)memento;
+ String projectName = mem.getString("ProjectName");
+ if(projectName == null) return null;
+ String componentName = mem.getString("ComponentName");
+ if(componentName == null) return null;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ ISeamComponent component = seamProject.getComponent(componentName);
+
+ return component;
}
@Override
protected void storeItemToMemento(Object item, IMemento memento) {
+
+ System.out.println("storeItemToMemento item - "+item.getClass()+"
memento - "+memento.getClass());
+ SeamComponent component = (SeamComponent)item;
+ XMLMemento mem = (XMLMemento)memento;
+ mem.putString("ProjectName",
component.getSeamProject().getProject().getName());
+ mem.putString("ComponentName", component.getName());
}
}