[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs ...
Robert Stryker
rawblem at gmail.com
Thu Jan 25 15:08:12 EST 2007
User: rawb
Date: 07/01/25 15:08:12
Modified: as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs
ConvertNodeToXPathDialog.java
Log:
Swapped dependency direction. MBeans now depends on ui, instead of the other way around.
Also fixed (temp) a bug in new mbean wizard due to upstream eclipse code (smite them, lord, please)
Revision Changes Path
1.4 +0 -86 jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConvertNodeToXPathDialog.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ConvertNodeToXPathDialog.java 12 Jan 2007 19:48:41 -0000 1.3
+++ ConvertNodeToXPathDialog.java 25 Jan 2007 20:08:12 -0000 1.4
@@ -52,9 +52,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.xml.core.internal.document.AttrImpl;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
import org.jboss.ide.eclipse.as.core.server.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.server.ServerAttributeHelper.SimpleXPathPreferenceTreeItem;
import org.jboss.ide.eclipse.as.core.server.ServerAttributeHelper.XPathPreferenceTreeItem;
@@ -62,9 +59,6 @@
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
-import org.jboss.ide.eclipse.as.ui.mbeans.editors.proposals.IServiceXMLOutlineActionProvider;
-import org.jboss.ide.eclipse.as.ui.mbeans.editors.proposals.IServiceXMLQuickFixProposalProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -226,58 +220,6 @@
}
- public static class ConvertNodeToXPathDialogProvider extends XMLContentAssistProcessor implements IServiceXMLQuickFixProposalProvider {
-
- public ICompletionProposal[] getProposals(ITextViewer viewer, int offset) {
- return computeCompletionProposals(viewer, offset);
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- Node n = contentAssistRequest.getNode();
- String name = n.getNodeName();
- String attName = ((AttrImpl)n.getAttributes().getNamedItem(contentAssistRequest.getText())).getName();
- contentAssistRequest.addProposal(createProposal(n, attName));
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- String elementName = contentAssistRequest.getNode().getNodeName();
- String match = contentAssistRequest.getMatchString();
- String text = contentAssistRequest.getText();
- int beginPos = contentAssistRequest.getReplacementBeginPosition();
-
- // find the attribute we're inside of, because the contentAssistRequester only returns the element (BOO!)
- NamedNodeMap map = contentAssistRequest.getNode().getAttributes();
-
- boolean found = false;
- AttrImpl attribute = null;
- for( int i = 0; i < map.getLength() && !found; i++ ) {
- Node tmp = map.item(i);
- if( tmp instanceof AttrImpl ) {
- int start = ((AttrImpl)tmp).getStartOffset();
- int end = ((AttrImpl)tmp).getEndOffset();
- if( beginPos > start && beginPos < end ) {
- found = true;
- attribute = (AttrImpl)tmp;
- }
- }
- }
- if( found ) {
- contentAssistRequest.addProposal(createProposal(contentAssistRequest.getNode(), attribute.getName()));
- }
- }
-
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- contentAssistRequest.addProposal(createProposal(contentAssistRequest.getNode(), null));
- }
-
-
- protected ICompletionProposal createProposal(Node node, String attributeName) {
- return new OpenXPathDialogProposal(node, attributeName);
- }
- }
public static class OpenXPathDialogProposal implements ICompletionProposal, ICompletionProposalExtension2 {
private Node node;
@@ -361,32 +303,4 @@
}
}
-
- public static class ConvertNodeToXPathDialogOutlineMenuItemProvider implements IServiceXMLOutlineActionProvider {
- public void release() {
- }
-
- public void menuAboutToShow(IMenuManager manager, ISelection selection) {
- Object o = ((IStructuredSelection)selection).getFirstElement();
- Node n;
- String attName = null;
- if( o instanceof Node ) {
- n = (Node)o;
- if( n instanceof AttrImpl) {
- attName = ((AttrImpl)n).getName();
- n = ((AttrImpl)n).getOwnerElement();
- }
- final Node n2 = n;
- final String attName2 = attName;
- Action temp = new Action() {
- public void run() {
- new ConvertNodeRunnable(n2, attName2).run();
- }
- };
- temp.setText("Add to XPaths");
- temp.setDescription("Add this element to the list of xpaths you can edit from the properties view.");
- manager.add(temp);
- }
- }
- }
}
More information about the jboss-cvs-commits
mailing list