View | Details | Raw Unified | Return to bug 243744 | Differences between
and this patch

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java (-2 / +22 lines)
Lines 61-66 Link Here
61
import org.eclipse.ui.forms.events.ExpansionAdapter;
61
import org.eclipse.ui.forms.events.ExpansionAdapter;
62
import org.eclipse.ui.forms.events.ExpansionEvent;
62
import org.eclipse.ui.forms.events.ExpansionEvent;
63
import org.eclipse.ui.forms.widgets.ExpandableComposite;
63
import org.eclipse.ui.forms.widgets.ExpandableComposite;
64
import org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog;
64
import org.eclipse.ui.part.ResourceTransfer;
65
import org.eclipse.ui.part.ResourceTransfer;
65
66
66
/**
67
/**
Lines 251-258 Link Here
251
		protected void createMainButton(Composite parent) {
252
		protected void createMainButton(Composite parent) {
252
			super.createMainButton(parent);
253
			super.createMainButton(parent);
253
			mainButton.setText(CompareMessages.CompareWithOtherResourceDialog_workspaceMainButton);
254
			mainButton.setText(CompareMessages.CompareWithOtherResourceDialog_workspaceMainButton);
254
			// temporarily hide this button. For more information about supporting for browsing workspace see bug 243744.
255
			mainButton.addSelectionListener(new SelectionListener() {
255
			mainButton.setVisible(false);
256
				public void widgetDefaultSelected(SelectionEvent e) {
257
					widgetSelected(e);
258
				}
259
				public void widgetSelected(SelectionEvent e) {
260
					setResource(getResourceFromDialog());
261
				}
262
			});
256
		}
263
		}
257
		
264
		
258
		protected void createText(Composite parent) {
265
		protected void createText(Composite parent) {
Lines 285-290 Link Here
285
			super.setResource(resource);
292
			super.setResource(resource);
286
			text.setText(resource.getFullPath().toOSString());
293
			text.setText(resource.getFullPath().toOSString());
287
		}
294
		}
295
		
296
		private IResource getResourceFromDialog() {
297
			IResource r = null;
298
			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
299
			OpenResourceDialog dialog = new OpenResourceDialog(getShell(), root, IResource.FILE);
300
			int returnCode = dialog.open();
301
			if (returnCode != IDialogConstants.OK_ID)
302
				return null;
303
			Object[] result = dialog.getResult();
304
			if (result.length > 0)
305
				r = (IResource) result[0];
306
			return r;
307
		}
288
308
289
		protected void initDrag() {
309
		protected void initDrag() {
290
			DragSource source = new DragSource(text, DND.DROP_MOVE
310
			DragSource source = new DragSource(text, DND.DROP_MOVE

Return to bug 243744