Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 165439 Details for
Bug 302441
[LinkedResources][CommonNavigator] When to show "Files and Folders Operation" dialog on drop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch (without API change)
patch.txt (text/plain), 10.89 KB, created by
Serge Beauchamp
on 2010-04-20 10:25:33 EDT
(
hide
)
Description:
Patch (without API change)
Filename:
MIME Type:
Creator:
Serge Beauchamp
Created:
2010-04-20 10:25:33 EDT
Size:
10.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java,v >retrieving revision 1.9 >diff -u -r1.9 ImportTypeDialog.java >--- src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java 19 Apr 2010 14:50:32 -0000 1.9 >+++ src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java 20 Apr 2010 08:54:35 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.jface.window.Window; > import org.eclipse.swt.SWT; > import org.eclipse.swt.dnd.DND; >+import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; > import org.eclipse.swt.graphics.Image; >@@ -32,13 +33,16 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Link; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.ISharedImages; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.dialogs.PreferencesUtil; > import org.eclipse.ui.internal.ide.IDEInternalPreferences; > import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; > import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; > import org.eclipse.ui.internal.ide.IIDEHelpContextIds; >+import org.eclipse.ui.internal.ide.dialogs.LinkedResourcesPreferencePage; > import org.eclipse.ui.internal.ide.dialogs.RelativePathVariableGroup; > import org.eclipse.ui.internal.ide.misc.OverlayIcon; > import org.eclipse.ui.plugin.AbstractUIPlugin; >@@ -80,8 +84,7 @@ > */ > public final static int IMPORT_VIRTUAL_FOLDERS_AND_LINKS = 2; > >- private Button alwaysPerformThisOperation = null; >- >+ private final static int IMPORT_WITHOUT_PROMPT = 32; > > private Button copyButton = null; > >@@ -237,22 +240,31 @@ > > String mode = store.getString(targetIsVirtual? IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE:IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE); > >+ if ((operationMask & IMPORT_WITHOUT_PROMPT) != 0) { >+ if (hasFlag(IMPORT_COPY)) >+ currentSelection = IMPORT_COPY; >+ if (hasFlag(IMPORT_LINK)) >+ currentSelection = IMPORT_LINK; >+ if (hasFlag(IMPORT_MOVE)) >+ currentSelection = IMPORT_MOVE; >+ return Window.OK; >+ } > if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_PROMPT)) > return super.open(); > if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY) && hasFlag(IMPORT_COPY)) { >- this.currentSelection = IMPORT_COPY; >+ currentSelection = IMPORT_COPY; > return Window.OK; > } > if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY) && hasFlag(IMPORT_MOVE)) { >- this.currentSelection = IMPORT_MOVE; >+ currentSelection = IMPORT_MOVE; > return Window.OK; > } > if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK) && hasFlag(IMPORT_LINK)) { >- this.currentSelection = IMPORT_LINK; >+ currentSelection = IMPORT_LINK; > return Window.OK; > } > if (mode.equals(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK_AND_VIRTUAL_FOLDER) && hasFlag(IMPORT_VIRTUAL_FOLDERS_AND_LINKS)) { >- this.currentSelection = IMPORT_VIRTUAL_FOLDERS_AND_LINKS; >+ currentSelection = IMPORT_VIRTUAL_FOLDERS_AND_LINKS; > return Window.OK; > } > >@@ -331,22 +343,6 @@ > > IPreferenceStore store = IDEWorkbenchPlugin.getDefault().getPreferenceStore(); > store.putValue(IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_RELATIVE, Boolean.toString(variable != null)); >- if (alwaysPerformThisOperation.getSelection()) { >- String mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_PROMPT; >- switch(currentSelection) { >- case IMPORT_COPY: >- case IMPORT_MOVE: >- mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_MOVE_COPY; >- break; >- case IMPORT_LINK: >- mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK; >- break; >- case IMPORT_VIRTUAL_FOLDERS_AND_LINKS: >- mode = IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE_LINK_AND_VIRTUAL_FOLDER; >- break; >- } >- store.putValue(targetIsVirtual? IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE:IDEInternalPreferences.IMPORT_FILES_AND_FOLDERS_MODE, mode); >- } > } > super.buttonPressed(buttonId); > } >@@ -466,16 +462,32 @@ > currentSelection = IMPORT_LINK; > parent.getShell().setText(IDEWorkbenchMessages.ImportTypeDialog_titleFilesLinking); > } >- alwaysPerformThisOperation = new Button(parent, SWT.CHECK); >- alwaysPerformThisOperation.setText(linkIsOnlyChoice? IDEWorkbenchMessages.ImportTypeDialog_alwaysUseLocationWhenLinkingFiles: IDEWorkbenchMessages.ImportTypeDialog_alwaysPerformThisOperation); >- gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); >- gridData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); >- alwaysPerformThisOperation.setLayoutData(gridData); >- >+ createLinkControl(parent); > refreshSelection(); > return composite; > } > >+ private Control createLinkControl(Composite composite) { >+ Link link= new Link(composite, SWT.WRAP | SWT.RIGHT); >+ link.setText(IDEWorkbenchMessages.ImportTypeDialog_configureSettings); >+ link.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ openSettingsPage(); >+ } >+ }); >+ GridData gridData= new GridData(GridData.FILL, GridData.CENTER, true, false); >+ gridData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); >+ link.setLayoutData(gridData); >+ link.setFont(composite.getFont()); >+ >+ return link; >+ } >+ >+ protected void openSettingsPage() { >+ String prefID = LinkedResourcesPreferencePage.PREF_ID; >+ PreferencesUtil.createPreferenceDialogOn(getShell(), prefID, new String[] {prefID}, null).open(); >+ } >+ > protected Control createMessageArea(Composite parent) { > Composite composite = new Composite(parent, 0); > GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); >@@ -540,10 +552,36 @@ > * @return the appropriate import mask given the files dropped on the target > */ > private static int selectAppropriateMask(int dropOperation, IResource[] resources, IContainer target) { >- int mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; >- if (!target.isVirtual() && (dropOperation != DND.DROP_LINK)) >- mask |= ImportTypeDialog.IMPORT_COPY; >- if (areOnlyFiles(resources)) >+ boolean onlyFiles = areOnlyFiles(resources); >+ int mask = selectAppropriateMask(dropOperation, target, onlyFiles); >+ return mask; >+ } >+ >+ /** >+ * @param dropOperation >+ * @param target >+ * @param onlyFiles >+ * @return the appropriate import mask given the objects dropped on the target >+ */ >+ private static int selectAppropriateMask(int dropOperation, >+ IContainer target, boolean onlyFiles) { >+ int mask; >+ switch (dropOperation) { >+ case DND.DROP_LINK: >+ mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; >+ break; >+ case DND.DROP_COPY: >+ if (!target.isVirtual()) { >+ mask = ImportTypeDialog.IMPORT_COPY | ImportTypeDialog.IMPORT_WITHOUT_PROMPT; >+ break; >+ } // otherwise, fall to default >+ case DND.DROP_MOVE: // always for prompt >+ default: >+ mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; >+ if (!target.isVirtual()) >+ mask |= ImportTypeDialog.IMPORT_COPY; >+ } >+ if (onlyFiles) > mask |= ImportTypeDialog.IMPORT_FILES_ONLY; > return mask; > } >@@ -560,11 +598,8 @@ > * @return the appropriate import mask given the files dropped on the target > */ > private static int selectAppropriateMask(int dropOperation, String[] names, IContainer target) { >- int mask = ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS | ImportTypeDialog.IMPORT_LINK; >- if (!target.isVirtual() && (dropOperation != DND.DROP_LINK)) >- mask |= ImportTypeDialog.IMPORT_COPY; >- if (areOnlyFiles(names)) >- mask |= ImportTypeDialog.IMPORT_FILES_ONLY; >+ boolean onlyFiles = areOnlyFiles(names); >+ int mask = selectAppropriateMask(dropOperation, target, onlyFiles); > return mask; > } > >Index: src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java,v >retrieving revision 1.84 >diff -u -r1.84 IDEWorkbenchMessages.java >--- src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 14 Apr 2010 14:32:05 -0000 1.84 >+++ src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 20 Apr 2010 08:54:36 -0000 >@@ -786,7 +786,7 @@ > public static String ImportTypeDialog_importElementsAsTooltipSet; > public static String ImportTypeDialog_editVariables; > public static String ImportTypeDialog_alwaysPerformThisOperation; >- public static String ImportTypeDialog_alwaysUseLocationWhenLinkingFiles; >+ public static String ImportTypeDialog_configureSettings; > > // ============================================================================== > // Editor Framework >Index: src/org/eclipse/ui/internal/ide/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties,v >retrieving revision 1.201 >diff -u -r1.201 messages.properties >--- src/org/eclipse/ui/internal/ide/messages.properties 14 Apr 2010 16:48:25 -0000 1.201 >+++ src/org/eclipse/ui/internal/ide/messages.properties 20 Apr 2010 08:54:37 -0000 >@@ -807,7 +807,7 @@ > ImportTypeDialog_importElementsAsTooltipSet=Link locations will be relative to a path variable, rather than absolute path locations > ImportTypeDialog_editVariables=Edit Variables... > ImportTypeDialog_alwaysPerformThisOperation=&Always perform the selected operation >-ImportTypeDialog_alwaysUseLocationWhenLinkingFiles=&Always use the selected location >+ImportTypeDialog_configureSettings=<a>Configure Drag and Drop Settings...</a> > # ============================================================================== > # Editor Framework > # ============================================================================== >Index: src/org/eclipse/ui/internal/ide/dialogs/LinkedResourcesPreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/LinkedResourcesPreferencePage.java,v >retrieving revision 1.10 >diff -u -r1.10 LinkedResourcesPreferencePage.java >--- src/org/eclipse/ui/internal/ide/dialogs/LinkedResourcesPreferencePage.java 24 Feb 2010 10:11:33 -0000 1.10 >+++ src/org/eclipse/ui/internal/ide/dialogs/LinkedResourcesPreferencePage.java 20 Apr 2010 08:54:37 -0000 >@@ -46,6 +46,8 @@ > IWorkbenchPreferencePage { > private Label topLabel; > >+ public static String PREF_ID = "org.eclipse.ui.preferencePages.LinkedResources"; //$NON-NLS-1$ >+ > private PathVariablesGroup pathVariablesGroup; > > private ResourceDragAndDropEditor dragAndDropHandlingEditor;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 302441
:
165394
|
165395
|
165439
|
165618