Author: rob.stryker(a)jboss.com
Date: 2009-06-18 05:16:31 -0400 (Thu, 18 Jun 2009)
New Revision: 16027
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
Log:
JBIDE-4490 - action bug in opening xpath dialog
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2009-06-18
08:52:31 UTC (rev 16026)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2009-06-18
09:16:31 UTC (rev 16027)
@@ -98,30 +98,34 @@
newXPathAction = new Action() {
public void run() {
+ XPathCategory category = null;
if(selectedNode instanceof XPathCategory) {
- XPathCategory category = (XPathCategory) selectedNode;
- if (category != null) {
- String categoryName = category.getName();
- XPathDialog d = new XPathDialog(Display.getCurrent()
- .getActiveShell(), getServer(), categoryName);
- if (d.open() == Window.OK) {
- XPathCategory[] categoryList = XPathModel.getDefault()
- .getCategories(getServer());
- XPathCategory categoryItem = null;
- for (int i = 0; i < categoryList.length; i++) {
- if (categoryList[i].getName().equals(
- category.getName()))
- categoryItem = categoryList[i];
- }
- if (categoryItem != null) {
- XPathQuery query = new XPathQuery(d.getName(),
- XPathDialogs.getConfigFolder(getServer()),
- null, d.getXpath(), d.getAttribute());
- categoryItem.addQuery(query);
- XPathModel.getDefault().save(getServer());
- refreshViewer();
- }
+ category = (XPathCategory) selectedNode;
+ } else if( selectedNode instanceof XPathQuery) {
+ category = ((XPathQuery)selectedNode).getCategory();
+ }
+
+ if (category != null) {
+ String categoryName = category.getName();
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), categoryName);
+ if (d.open() == Window.OK) {
+ XPathCategory[] categoryList = XPathModel.getDefault()
+ .getCategories(getServer());
+ XPathCategory categoryItem = null;
+ for (int i = 0; i < categoryList.length; i++) {
+ if (categoryList[i].getName().equals(
+ category.getName()))
+ categoryItem = categoryList[i];
}
+ if (categoryItem != null) {
+ XPathQuery query = new XPathQuery(d.getName(),
+ XPathDialogs.getConfigFolder(getServer()),
+ null, d.getXpath(), d.getAttribute());
+ categoryItem.addQuery(query);
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
}
}
}