Skip to content

Commit

Permalink
JBIDE-21116 - new xpath dialog cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robstryker committed Nov 20, 2015
1 parent 1cb8627 commit f471421
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void run() {
String defaultFolder = o == null ? "" : o.getNewFilesetDefaultRootFolder(); //$NON-NLS-1$

if (defaultFolder != null) {
FilesetDialog d = new FilesetDialog(new Shell(), defaultFolder, iserver);
FilesetDialog d = new FilesetDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), defaultFolder, iserver);
if (d.open() == Window.OK) {
Fileset fs = d.getFileset();
wrapper.addFileset(fs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ public XPathQuery(IServer server, String name, String baseDir,
}

private String getReplacedString(String original) {
RuntimeVariableResolver resolver = new RuntimeVariableResolver(server.getRuntime());
ExpressionResolver process = new ExpressionResolver(resolver);
return process.resolve(original);
if( server != null ) {
RuntimeVariableResolver resolver = new RuntimeVariableResolver(server.getRuntime());
ExpressionResolver process = new ExpressionResolver(resolver);
return process.resolve(original);
}
return original;
}

private void setEffectiveBaseDir() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XMLDocumentRepository;
Expand Down Expand Up @@ -423,7 +424,7 @@ public void run() {
}
};
try {
new ProgressMonitorDialog(new Shell()).run(true, true, op);
new ProgressMonitorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()).run(true, true, op);
} catch (InvocationTargetException e) {
//Do not need to do anything
} catch (InterruptedException e) {
Expand Down Expand Up @@ -707,7 +708,7 @@ public String[] getAttributeNameProposalStrings(String parentPath, String remain
XPathResultNode[] items = getXPath(parentPath);
String[] attributes;
for( int i = 0; i < items.length; i++ ) {
attributes = items[0].getElementAttributeNames();
attributes = items[i].getElementAttributeNames();
for( int j = 0; j < attributes.length; j++ ) {
if( attributes[j].startsWith(remainder) && !names.contains(attributes[j]))
names.add(attributes[j]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ public XPathTreeLabelProvider() {
ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/XMLFile.gif")); //$NON-NLS-1$
rootImage = des.createImage();
}
// public boolean useNativeToolTip(Object object) {
// return true;
// }
// public String getToolTipText(Object element) {
// return "BLAAAAAAAH";
// }


public Image getImage(Object element) {
if( element instanceof ServerWrapper )
return rootImage;
Expand Down

0 comments on commit f471421

Please sign in to comment.