### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.xsl.debug.ui Index: src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java =================================================================== RCS file: /cvsroot/webtools/incubator/sourceediting/plugins/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java,v retrieving revision 1.10 diff -u -r1.10 InputFileBlock.java --- src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java 23 Feb 2009 22:36:36 -0000 1.10 +++ src/org/eclipse/wst/xsl/internal/debug/ui/tabs/main/InputFileBlock.java 5 Mar 2009 21:09:56 -0000 @@ -7,6 +7,7 @@ * * Contributors: * Doug Satchwell (Chase Technology Ltd) - initial API and implementation + * Stuart Harper - added "open files" selector *******************************************************************************/ package org.eclipse.wst.xsl.internal.debug.ui.tabs.main; @@ -135,6 +136,10 @@ return Messages.InputFileBlock_WORKSPACE_BUTTON; case WORKSPACE_DIALOG_TITLE: return Messages.InputFileBlock_WORKSPACE_DIALOG_TITLE; + case OPENFILES_BUTTON: + return Messages.InputFileBlock_OPENFILES_BUTTON; + case OPENFILES_DIALOG_TITLE: + return Messages.InputFileBlock_OPENFILES_DIALOG; } return "" + type; //$NON-NLS-1$ } Index: src/org/eclipse/wst/xsl/debug/ui/Messages.java =================================================================== RCS file: /cvsroot/webtools/incubator/sourceediting/plugins/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/Messages.java,v retrieving revision 1.3 diff -u -r1.3 Messages.java --- src/org/eclipse/wst/xsl/debug/ui/Messages.java 12 Jan 2009 00:50:22 -0000 1.3 +++ src/org/eclipse/wst/xsl/debug/ui/Messages.java 5 Mar 2009 21:09:55 -0000 @@ -8,6 +8,7 @@ * Contributors: * Doug Satchwell (Chase Technology Ltd) - initial API and implementation * David Carver (STAR) - updated to meet Galileo requirements + * Stuart Harper - added "open files" selector *******************************************************************************/ package org.eclipse.wst.xsl.debug.ui; @@ -125,6 +126,10 @@ public static String InputFileBlock_FILE_SYSTEM_BUTTON; public static String InputFileBlock_WORKSPACE_BUTTON; + + public static String InputFileBlock_OPENFILES_BUTTON; + + public static String InputFileBlock_OPENFILES_DIALOG; public static String InputFileBlock_Name; Index: src/org/eclipse/wst/xsl/debug/ui/messages.properties =================================================================== RCS file: /cvsroot/webtools/incubator/sourceediting/plugins/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/debug/ui/messages.properties,v retrieving revision 1.3 diff -u -r1.3 messages.properties --- src/org/eclipse/wst/xsl/debug/ui/messages.properties 12 Jan 2009 00:50:22 -0000 1.3 +++ src/org/eclipse/wst/xsl/debug/ui/messages.properties 5 Mar 2009 21:09:56 -0000 @@ -41,6 +41,8 @@ InputFileBlock_VARIABLES_BUTTON=Variables... InputFileBlock_FILE_SYSTEM_BUTTON=File System... InputFileBlock_WORKSPACE_BUTTON=Workspace... +InputFileBlock_OPENFILES_BUTTON=Open Files... +InputFileBlock_OPENFILES_DIALOG=Select File InputFileBlock_Name=XML Input File InputFileBlock_Exception_occurred_reading_configuration=Exception occurred reading configuration InputFileBlock_WORKSPACE_DIALOG_TITLE=File Selection Index: src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java =================================================================== RCS file: /cvsroot/webtools/incubator/sourceediting/plugins/org.eclipse.wst.xsl.debug.ui/src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java,v retrieving revision 1.12 diff -u -r1.12 ResourceSelectionBlock.java --- src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java 26 Feb 2009 16:24:08 -0000 1.12 +++ src/org/eclipse/wst/xsl/internal/debug/ui/ResourceSelectionBlock.java 5 Mar 2009 21:09:56 -0000 @@ -7,11 +7,16 @@ * * Contributors: * Doug Satchwell (Chase Technology Ltd) - initial API and implementation + * Stuart Harper - added "open files" selector *******************************************************************************/ package org.eclipse.wst.xsl.internal.debug.ui; import java.io.File; - +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; @@ -26,6 +31,9 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; import org.eclipse.debug.ui.StringVariableSelectionDialog; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.window.Window; @@ -43,8 +51,16 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IEditorDescriptor; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.ui.dialogs.ISelectionStatusValidator; +import org.eclipse.ui.dialogs.ListDialog; +import org.eclipse.ui.dialogs.ListSelectionDialog; +import org.eclipse.ui.model.BaseWorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.views.navigator.ResourceComparator; @@ -71,10 +87,13 @@ protected static final int FILE_SYSTEM_BUTTON = 9; protected static final int WORKSPACE_BUTTON = 10; protected static final int WORKSPACE_DIALOG_TITLE = 11; + protected static final int OPENFILES_BUTTON = 12; + protected static final int OPENFILES_DIALOG_TITLE = 13; protected Button fWorkspaceButton; protected Button fFileSystemButton; protected Button fVariablesButton; + protected Button fOpenFilesButton; protected Button useDefaultCheckButton; protected Text resourceText; protected WidgetListener widgetListener = new WidgetListener(); @@ -134,6 +153,10 @@ { updateResourceText(useDefaultCheckButton.getSelection()); } + else if (source == fOpenFilesButton) + { + handleOpenFilesResourceBrowseButtonSelected(); + } } } @@ -267,7 +290,7 @@ new Label(parent, SWT.NONE); Composite buttonComp = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(3, false); + GridLayout layout = new GridLayout(4, false); layout.marginHeight = 0; layout.marginWidth = 0; buttonComp.setLayout(layout); @@ -284,6 +307,9 @@ fVariablesButton = createPushButton(buttonComp, getMessage(VARIABLES_BUTTON), null); fVariablesButton.addSelectionListener(widgetListener); + + fOpenFilesButton = createPushButton(buttonComp, getMessage(OPENFILES_BUTTON), null); + fOpenFilesButton.addSelectionListener(widgetListener); } protected void updateResourceText(boolean useDefault) @@ -359,6 +385,44 @@ { return null; } + + protected void handleOpenFilesResourceBrowseButtonSelected() + { + String path = openFileListResourceDialog(); + if (path != null) + setText("${workspace_loc:" + path + "}"); //$NON-NLS-1$ //$NON-NLS-2$ + } + /** + * Opens a dialog displaying a list of all XML files in the editor and allows the user to select one of them. + * @return The path to the selected XML file or null if none was chosen. + */ + protected String openFileListResourceDialog(){ + IEditorReference[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences(); + + WorkbenchContentProvider w = new WorkbenchContentProvider(); + String [] paths = new String[editors.length]; + + for(int i =0; i