Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBIDE-21116 - new xpath dialog cleanup #383

Merged
merged 1 commit into from
Nov 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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