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 4500 Details for
Bug 36197
[Preferences] Should offer to restart after importing preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Suggested rework when core issues fixed
36197.txt (text/plain), 65.49 KB, created by
Tod Creasey
on 2003-04-08 13:13:20 EDT
(
hide
)
Description:
Suggested rework when core issues fixed
Filename:
MIME Type:
Creator:
Tod Creasey
Created:
2003-04-08 13:13:20 EDT
Size:
65.49 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/Workbench.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java,v >retrieving revision 1.63 >diff -u -r1.63 Workbench.java >--- Eclipse UI/org/eclipse/ui/internal/Workbench.java 11 Mar 2003 17:12:43 -0000 1.63 >+++ Eclipse UI/org/eclipse/ui/internal/Workbench.java 8 Apr 2003 17:08:08 -0000 >@@ -11,103 +11,35 @@ > > package org.eclipse.ui.internal; > >-import java.io.BufferedReader; >-import java.io.File; >-import java.io.FileInputStream; >-import java.io.FileOutputStream; >-import java.io.IOException; >-import java.io.InputStreamReader; >-import java.io.OutputStreamWriter; >+import java.io.*; > import java.lang.reflect.InvocationTargetException; > import java.util.ArrayList; > import java.util.Iterator; > > import org.eclipse.core.boot.IPlatformRunnable; >-import org.eclipse.core.resources.IContainer; >-import org.eclipse.core.resources.IMarker; >-import org.eclipse.core.resources.IMarkerDelta; >-import org.eclipse.core.resources.IResource; >-import org.eclipse.core.resources.IResourceChangeEvent; >-import org.eclipse.core.resources.IResourceChangeListener; >-import org.eclipse.core.resources.IResourceDelta; >-import org.eclipse.core.resources.IWorkspace; >-import org.eclipse.core.resources.IWorkspaceDescription; >-import org.eclipse.core.resources.IncrementalProjectBuilder; >-import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IAdaptable; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IExecutableExtension; >-import org.eclipse.core.runtime.IExtension; >-import org.eclipse.core.runtime.IExtensionPoint; >-import org.eclipse.core.runtime.IPath; >-import org.eclipse.core.runtime.IPluginDescriptor; >-import org.eclipse.core.runtime.IPluginRegistry; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.MultiStatus; >-import org.eclipse.core.runtime.Platform; >-import org.eclipse.core.runtime.Plugin; >-import org.eclipse.core.runtime.Status; >+import org.eclipse.core.resources.*; >+import org.eclipse.core.runtime.*; > import org.eclipse.jface.action.ActionContributionItem; >-import org.eclipse.jface.dialogs.ErrorDialog; >-import org.eclipse.jface.dialogs.IDialogConstants; >-import org.eclipse.jface.dialogs.MessageDialog; >-import org.eclipse.jface.dialogs.ProgressMonitorDialog; >+import org.eclipse.jface.dialogs.*; > import org.eclipse.jface.operation.IRunnableWithProgress; > import org.eclipse.jface.operation.ModalContext; >-import org.eclipse.jface.preference.IPreferenceStore; >-import org.eclipse.jface.preference.PreferenceConverter; >-import org.eclipse.jface.preference.PreferenceManager; >-import org.eclipse.jface.resource.FontRegistry; >-import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.jface.resource.JFaceColors; >-import org.eclipse.jface.resource.JFaceResources; >-import org.eclipse.jface.util.IPropertyChangeListener; >-import org.eclipse.jface.util.ListenerList; >-import org.eclipse.jface.util.OpenStrategy; >-import org.eclipse.jface.util.PropertyChangeEvent; >-import org.eclipse.jface.util.SafeRunnable; >+import org.eclipse.jface.preference.*; >+import org.eclipse.jface.resource.*; >+import org.eclipse.jface.util.*; > import org.eclipse.jface.window.Window; > import org.eclipse.jface.window.WindowManager; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.BusyIndicator; >-import org.eclipse.swt.graphics.DeviceData; >-import org.eclipse.swt.graphics.FontData; >-import org.eclipse.swt.graphics.Image; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.Display; >-import org.eclipse.swt.widgets.Event; >-import org.eclipse.swt.widgets.Listener; >-import org.eclipse.swt.widgets.Shell; >-import org.eclipse.ui.IDecoratorManager; >-import org.eclipse.ui.IEditorPart; >-import org.eclipse.ui.IEditorRegistry; >-import org.eclipse.ui.IMarkerHelpRegistry; >-import org.eclipse.ui.IMemento; >-import org.eclipse.ui.IPerspectiveDescriptor; >-import org.eclipse.ui.IPerspectiveRegistry; >-import org.eclipse.ui.ISharedImages; >-import org.eclipse.ui.IStartup; >-import org.eclipse.ui.IViewPart; >-import org.eclipse.ui.IWindowListener; >-import org.eclipse.ui.IWorkbench; >-import org.eclipse.ui.IWorkbenchPage; >-import org.eclipse.ui.IWorkbenchPart; >-import org.eclipse.ui.IWorkbenchWindow; >-import org.eclipse.ui.IWorkingSetManager; >-import org.eclipse.ui.PartInitException; >-import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.WorkbenchException; >-import org.eclipse.ui.XMLMemento; >+import org.eclipse.swt.graphics.*; >+import org.eclipse.swt.widgets.*; >+import org.eclipse.ui.*; > import org.eclipse.ui.actions.GlobalBuildAction; > import org.eclipse.ui.actions.WorkspaceModifyOperation; > import org.eclipse.ui.internal.decorators.DecoratorManager; > import org.eclipse.ui.internal.dialogs.WelcomeEditorInput; > import org.eclipse.ui.internal.fonts.FontDefinition; >+import org.eclipse.ui.internal.misc.*; > import org.eclipse.ui.internal.misc.Assert; >-import org.eclipse.ui.internal.misc.Policy; >-import org.eclipse.ui.internal.misc.UIStats; > import org.eclipse.ui.internal.model.WorkbenchAdapterBuilder; > import org.eclipse.update.core.SiteManager; > >@@ -115,7 +47,8 @@ > * The workbench class represents the top of the ITP user interface. Its primary > * responsability is the management of workbench windows and other ISV windows. > */ >-public class Workbench implements IWorkbench, IPlatformRunnable, IExecutableExtension { >+public class Workbench >+ implements IWorkbench, IPlatformRunnable, IExecutableExtension { > > private WindowManager windowManager; > private WorkbenchWindow activatedWindow; >@@ -131,9 +64,9 @@ > private String[] commandLineArgs; > private final IPropertyChangeListener propertyChangeListener = > new IPropertyChangeListener() { >- public void propertyChange(PropertyChangeEvent event) { >- handlePropertyChange(event); >- } >+ public void propertyChange(PropertyChangeEvent event) { >+ handlePropertyChange(event); >+ } > }; > > private static final String VERSION_STRING[] = { "0.046", "2.0" }; //$NON-NLS-1$ //$NON-NLS-2$ >@@ -142,6 +75,7 @@ > private static final int RESTORE_CODE_RESET = 1; > private static final int RESTORE_CODE_EXIT = 2; > protected static final String WELCOME_EDITOR_ID = "org.eclipse.ui.internal.dialogs.WelcomeEditor"; //$NON-NLS-1$ >+ private static final String TRUE_CONSTANT = "true"; > > /** > * Workbench constructor comment. >@@ -153,39 +87,43 @@ > getShowTasksChangeListener(), > IResourceChangeEvent.POST_CHANGE); > } >- >- >+ > // TODO: The code for bringing the Tasks view to front must be moved > // to org.eclipse.ui.views. >- >+ > /** > * The id of the Tasks view. > */ > private static final String TASK_LIST_ID = WorkbenchPlugin.PI_WORKBENCH + ".views.TaskList"; //$NON-NLS-1$ >- >- >+ > /** > * Returns the resource change listener for noticing new errors. > * Processes the delta and shows the Tasks view if new errors > * have appeared. See PR 2066. >- */ >+ */ > private IResourceChangeListener getShowTasksChangeListener() { > return new IResourceChangeListener() { >- public void resourceChanged(final IResourceChangeEvent event) { >+ public void resourceChanged(final IResourceChangeEvent event) { > IPreferenceStore store = getPreferenceStore(); >- if (store.getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)) { >+ if (store >+ .getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)) { > IMarker error = findProblemToShow(event); > if (error != null) { > Display.getDefault().asyncExec(new Runnable() { > public void run() { > try { >- IWorkbenchWindow window = getActiveWorkbenchWindow(); >- if (window != null && !window.getShell().isDisposed()) { >- IWorkbenchPage page = window.getActivePage(); >+ IWorkbenchWindow window = >+ getActiveWorkbenchWindow(); >+ if (window != null >+ && !window.getShell().isDisposed()) { >+ IWorkbenchPage page = >+ window.getActivePage(); > if (page != null) { >- IViewPart tasksView= page.findView(TASK_LIST_ID); >- if(tasksView == null) { >- IWorkbenchPart activePart= page.getActivePart(); >+ IViewPart tasksView = >+ page.findView(TASK_LIST_ID); >+ if (tasksView == null) { >+ IWorkbenchPart activePart = >+ page.getActivePart(); > page.showView(TASK_LIST_ID); > //restore focus stolen by showing the Tasks view > page.activate(activePart); >@@ -204,25 +142,27 @@ > } > }; > } >- >+ > /** > * Finds the first problem marker to show. > * Returns the first added error or warning. > */ > private IMarker findProblemToShow(IResourceChangeEvent event) { >- IMarkerDelta[] markerDeltas = event.findMarkerDeltas(IMarker.PROBLEM, true); >+ IMarkerDelta[] markerDeltas = >+ event.findMarkerDeltas(IMarker.PROBLEM, true); > for (int i = 0; i < markerDeltas.length; i++) { > IMarkerDelta markerDelta = markerDeltas[i]; > if (markerDelta.getKind() == IResourceDelta.ADDED) { > int sev = markerDelta.getAttribute(IMarker.SEVERITY, -1); >- if (sev == IMarker.SEVERITY_ERROR || sev == IMarker.SEVERITY_WARNING) { >+ if (sev == IMarker.SEVERITY_ERROR >+ || sev == IMarker.SEVERITY_WARNING) { > return markerDelta.getMarker(); > } > } > } > return null; > } >- >+ > /** > * See IWorkbench > */ >@@ -252,7 +192,7 @@ > // Do not hang onto it so it can be GC'ed > activatedWindow = null; > } >- >+ > Object list[] = windowListeners.getListeners(); > for (int i = 0; i < list.length; i++) { > ((IWindowListener) list[i]).windowClosed(window); >@@ -294,8 +234,10 @@ > if (!isClosing && !force) > return false; > >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- boolean closeEditors = store.getBoolean(IPreferenceConstants.CLOSE_EDITORS_ON_EXIT); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); >+ boolean closeEditors = >+ store.getBoolean(IPreferenceConstants.CLOSE_EDITORS_ON_EXIT); > if (closeEditors) { > Platform.run(new SafeRunnable() { > public void run() { >@@ -303,7 +245,8 @@ > for (int i = 0; i < windows.length; i++) { > IWorkbenchPage pages[] = windows[i].getPages(); > for (int j = 0; j < pages.length; j++) { >- isClosing = isClosing && pages[j].closeAllEditors(false); >+ isClosing = >+ isClosing && pages[j].closeAllEditors(false); > } > } > } >@@ -372,9 +315,11 @@ > for (int k = 0; k < editors.length; k++) { > IEditorPart editor = editors[k]; > if (editor.isDirty()) { >- if (!dirtyEditorsInput.contains(editor.getEditorInput())) { >+ if (!dirtyEditorsInput >+ .contains(editor.getEditorInput())) { > dirtyEditors.add(editor); >- dirtyEditorsInput.add(editor.getEditorInput()); >+ dirtyEditorsInput.add( >+ editor.getEditorInput()); > } > } > } >@@ -384,7 +329,8 @@ > IWorkbenchWindow w = getActiveWorkbenchWindow(); > if (w == null) > w = windows[0]; >- result[0] = EditorManager.saveAll(dirtyEditors, finalConfirm, w); >+ result[0] = >+ EditorManager.saveAll(dirtyEditors, finalConfirm, w); > } > } > }); >@@ -395,7 +341,10 @@ > * > * Assumes that busy cursor is active. > */ >- private IWorkbenchWindow busyOpenWorkbenchWindow(String perspID, IAdaptable input) throws WorkbenchException { >+ private IWorkbenchWindow busyOpenWorkbenchWindow( >+ String perspID, >+ IAdaptable input) >+ throws WorkbenchException { > // Create a workbench window (becomes active window) > WorkbenchWindow newWindow = newWorkbenchWindow(); > newWindow.create(); // must be created before adding to window manager >@@ -457,7 +406,7 @@ > }); > return ret[0]; > } >- >+ > /** > * Creates the action builder for the given window. > * >@@ -467,8 +416,7 @@ > protected WorkbenchActionBuilder createActionBuilder(IWorkbenchWindow window) { > return new WorkbenchActionBuilder(window); > } >- >- >+ > /** > * Connect to the core workspace. > */ >@@ -481,22 +429,18 @@ > private void disableAutoBuild() { > IWorkspace workspace = ResourcesPlugin.getWorkspace(); > IWorkspaceDescription description = workspace.getDescription(); >- >+ > autoBuild = description.isAutoBuilding(); > if (autoBuild) { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- store.setValue(IPreferenceConstants.AUTO_BUILD, false); > description.setAutoBuilding(false); > try { > workspace.setDescription(description); >- } catch (CoreException exception) { >- MessageDialog.openError( >- null, >- WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >- WorkbenchMessages.getString("Restoring_Problem")); //$NON-NLS-1$ >+ } catch (CoreException exception) { >+ MessageDialog.openError(null, WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >+ WorkbenchMessages.getString("Restoring_Problem")); //$NON-NLS-1$ > } > } >- } >+ } > /** > * Disconnect from the core workspace. > */ >@@ -506,7 +450,8 @@ > IRunnableWithProgress runnable = new IRunnableWithProgress() { > public void run(IProgressMonitor monitor) { > try { >- status.merge(ResourcesPlugin.getWorkspace().save(true, monitor)); >+ status.merge( >+ ResourcesPlugin.getWorkspace().save(true, monitor)); > } catch (CoreException e) { > status.merge(e.getStatus()); > } >@@ -537,14 +482,16 @@ > private void enableAutoBuild() { > if (autoBuild) { > IWorkbenchWindow windows[] = getWorkbenchWindows(); >- Shell shell = windows[windows.length - 1].getShell(); >+ Shell shell = windows[windows.length - 1].getShell(); > try { > WorkspaceModifyOperation op = new WorkspaceModifyOperation() { >- protected void execute(IProgressMonitor monitor) throws CoreException { >- monitor.setTaskName(WorkbenchMessages.getString("Workbench.autoBuild")); //$NON-NLS-1$ >+ protected void execute(IProgressMonitor monitor) >+ throws CoreException { >+ monitor.setTaskName(WorkbenchMessages.getString("Workbench.autoBuild")); //$NON-NLS-1$ > > IWorkspace workspace = ResourcesPlugin.getWorkspace(); >- IWorkspaceDescription description = workspace.getDescription(); >+ IWorkspaceDescription description = >+ workspace.getDescription(); > description.setAutoBuilding(true); > workspace.setDescription(description); > } >@@ -556,16 +503,10 @@ > new ProgressMonitorDialog(shell).run(true, true, op); > } catch (InterruptedException e) { > } catch (InvocationTargetException exception) { >- MessageDialog.openError( >- shell, >- WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >- WorkbenchMessages.getString("Workspace.problemAutoBuild")); //$NON-NLS-1$ >- } >- // update the preference store so that property change listener >- // get notified of preference change. >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- store.setValue(IPreferenceConstants.AUTO_BUILD, true); >- updateBuildActions(true); >+ MessageDialog.openError(shell, WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >+ WorkbenchMessages.getString("Workspace.problemAutoBuild")); //$NON-NLS-1$ >+ } >+ updateBuildActions(true); > } > } > /** >@@ -587,14 +528,14 @@ > return (IWorkbenchWindow) data; > shell = shell.getParent(); > } >- >+ > // Look for the window that was last known being > // the active one > WorkbenchWindow win = getActivatedWindow(); > if (win != null) { > return win; > } >- >+ > // Look at all the shells and pick the first one > // that is a workbench window. > Shell shells[] = display.getShells(); >@@ -603,7 +544,7 @@ > if (data instanceof IWorkbenchWindow) > return (IWorkbenchWindow) data; > } >- >+ > // Can't find anything! > return null; > } >@@ -617,14 +558,16 @@ > * subclass this internal class. > */ > return commandLineArgs; >- } >+ } > /** > * Returns the editor history. > */ > public EditorHistory getEditorHistory() { > if (editorHistory == null) { > IPreferenceStore store = getPreferenceStore(); >- editorHistory = new EditorHistory(store.getInt(IPreferenceConstants.RECENT_FILES)); >+ editorHistory = >+ new EditorHistory( >+ store.getInt(IPreferenceConstants.RECENT_FILES)); > } > return editorHistory; > } >@@ -645,7 +588,7 @@ > public IEditorRegistry getEditorRegistry() { > return WorkbenchPlugin.getDefault().getEditorRegistry(); > } >- >+ > /** > * Returns the number for a new window. This will be the first > * number > 0 which is not used to identify another window in >@@ -677,7 +620,7 @@ > } > return count + 1; > } >- >+ > /** > * Returns the perspective registry for the workbench. > * >@@ -727,7 +670,7 @@ > * @return the about info > */ > public WorkbenchConfigurationInfo getConfigurationInfo() { >- if(configurationInfo == null) >+ if (configurationInfo == null) > configurationInfo = new WorkbenchConfigurationInfo(); > return configurationInfo; > } >@@ -766,19 +709,21 @@ > public IWorkingSetManager getWorkingSetManager() { > return WorkbenchPlugin.getDefault().getWorkingSetManager(); > } >- >+ > public void updateActiveKeyBindingService() { > IWorkbenchWindow workbenchWindow = getActiveWorkbenchWindow(); >- >- if (workbenchWindow != null && workbenchWindow instanceof WorkbenchWindow) { >- WWinKeyBindingService wWinKeyBindingService = ((WorkbenchWindow) workbenchWindow).getKeyBindingService(); >- >+ >+ if (workbenchWindow != null >+ && workbenchWindow instanceof WorkbenchWindow) { >+ WWinKeyBindingService wWinKeyBindingService = >+ ((WorkbenchWindow) workbenchWindow).getKeyBindingService(); >+ > if (wWinKeyBindingService != null) { > IWorkbenchPage activePage = workbenchWindow.getActivePage(); >- >+ > if (activePage != null) { > IWorkbenchPart activePart = activePage.getActivePart(); >- >+ > if (activePart != null) { > wWinKeyBindingService.update(activePart); > return; >@@ -786,10 +731,10 @@ > } > > wWinKeyBindingService.clear(); >- } >+ } > } > } >- >+ > /** > * Listener for preference changes. > */ >@@ -797,9 +742,14 @@ > if (event.getProperty().equals(IPreferenceConstants.AUTO_BUILD)) { > // Auto build is stored in core. It is also in the preference > // store for use by import/export. >- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); >+ IWorkspaceDescription description = >+ ResourcesPlugin.getWorkspace().getDescription(); > boolean autoBuildSetting = description.isAutoBuilding(); >- boolean newAutoBuildSetting = getPreferenceStore().getBoolean(IPreferenceConstants.AUTO_BUILD); >+ boolean newAutoBuildSetting = true; >+ >+ //As this is an obsolete preference the reset to default may be null >+ if(event.getNewValue() != null) >+ newAutoBuildSetting = event.getNewValue().equals(TRUE_CONSTANT); > > if (autoBuildSetting != newAutoBuildSetting) { > // Update the core setting. >@@ -810,17 +760,21 @@ > } catch (CoreException e) { > WorkbenchPlugin.log("Error changing auto build preference setting.", e.getStatus()); //$NON-NLS-1$ > } >- >- // If auto build is turned on, then do a global incremental >- // build on all the projects. >- if (newAutoBuildSetting) { >- GlobalBuildAction action = new GlobalBuildAction( >+ } >+ } >+ if (event.getProperty().equals(ResourcesPlugin.PREF_AUTO_BUILDING)) { >+ // If auto build is turned on, then do a global incremental >+ // build on all the projects. >+ boolean newAutoBuildSetting = >+ event.getNewValue().equals(TRUE_CONSTANT); >+ if (newAutoBuildSetting) { >+ GlobalBuildAction action = >+ new GlobalBuildAction( > getActiveWorkbenchWindow(), > IncrementalProjectBuilder.INCREMENTAL_BUILD); >- action.doBuild(); >- } >- updateBuildActions(newAutoBuildSetting); >+ action.doBuild(); > } >+ updateBuildActions(newAutoBuildSetting); > } > } > /** >@@ -828,7 +782,7 @@ > * > * @return true if init succeeded. > */ >- private boolean init(String[] commandLineArgs) { >+ private boolean init(String[] commandLineArgs) { > this.commandLineArgs = commandLineArgs; > > if (WorkbenchPlugin.getDefault().isDebugging()) { >@@ -841,12 +795,13 @@ > addAdapters(); > windowManager = new WindowManager(); > WorkbenchColors.startup(); >- boolean useColorIcons = getPreferenceStore().getBoolean(IPreferenceConstants.COLOR_ICONS); >+ boolean useColorIcons = >+ getPreferenceStore().getBoolean(IPreferenceConstants.COLOR_ICONS); > ActionContributionItem.setUseColorIconsInToolbars(useColorIcons); >- initializeFonts(); >+ initializeFonts(); > initializeSingleClickOption(); > boolean avoidDeadlock = true; >- >+ > for (int i = 0; i < commandLineArgs.length; i++) { > if (commandLineArgs[i].equalsIgnoreCase("-allowDeadlock")) //$NON-NLS-1$ > avoidDeadlock = false; >@@ -856,7 +811,10 @@ > if (avoidDeadlock) { > try { > Display display = Display.getCurrent(); >- UIWorkspaceLock uiLock = new UIWorkspaceLock(WorkbenchPlugin.getPluginWorkspace(), display); >+ UIWorkspaceLock uiLock = >+ new UIWorkspaceLock( >+ WorkbenchPlugin.getPluginWorkspace(), >+ display); > WorkbenchPlugin.getPluginWorkspace().setWorkspaceLock(uiLock); > display.setSynchronizer(new UISynchronizer(display, uiLock)); > } catch (CoreException e) { >@@ -886,8 +844,10 @@ > return true; > } > private void refreshFromLocal(String[] commandLineArgs) { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- boolean refresh = store.getBoolean(IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); >+ boolean refresh = >+ store.getBoolean(IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP); > if (!refresh) > return; > //Do not refresh if it was already done by core on startup. >@@ -900,9 +860,11 @@ > final CoreException ex[] = new CoreException[1]; > try { > dlg.run(true, true, new IRunnableWithProgress() { >- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { >+ public void run(IProgressMonitor monitor) >+ throws InvocationTargetException, InterruptedException { > try { >- IContainer root = ResourcesPlugin.getWorkspace().getRoot(); >+ IContainer root = >+ ResourcesPlugin.getWorkspace().getRoot(); > root.refreshLocal(IResource.DEPTH_INFINITE, monitor); > } catch (CoreException e) { > ex[0] = e; >@@ -912,13 +874,24 @@ > if (ex[0] != null) { > String errorTitle = WorkbenchMessages.getString("Workspace.problemsTitle"); //$NON-NLS-1$ > String msg = WorkbenchMessages.getString("Workspace.problemMessage"); //$NON-NLS-1$ >- ErrorDialog.openError(shell, errorTitle, msg, ex[0].getStatus()); >+ ErrorDialog.openError( >+ shell, >+ errorTitle, >+ msg, >+ ex[0].getStatus()); > } > } catch (InterruptedException e) { > //Do nothing. Operation was canceled. > } catch (InvocationTargetException e) { > String msg = "InvocationTargetException refreshing from local on startup"; //$NON-NLS-1$ >- WorkbenchPlugin.log(msg, new Status(Status.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e.getTargetException())); >+ WorkbenchPlugin.log( >+ msg, >+ new Status( >+ Status.ERROR, >+ PlatformUI.PLUGIN_ID, >+ 0, >+ msg, >+ e.getTargetException())); > } > } > >@@ -938,7 +911,8 @@ > } > if (perspId == null) > return; >- IPerspectiveDescriptor desc = getPerspectiveRegistry().findPerspectiveWithId(perspId); >+ IPerspectiveDescriptor desc = >+ getPerspectiveRegistry().findPerspectiveWithId(perspId); > if (desc == null) > return; > >@@ -949,16 +923,25 @@ > showPerspective(perspId, win); > } catch (WorkbenchException e) { > String msg = "Workbench exception showing specified command line perspective on startup."; //$NON-NLS-1$ >- WorkbenchPlugin.log(msg, new Status(Status.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); >+ WorkbenchPlugin.log( >+ msg, >+ new Status(Status.ERROR, PlatformUI.PLUGIN_ID, 0, msg, e)); > } > } > > private void initializeSingleClickOption() { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- boolean openOnSingleClick = store.getBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); >- boolean selectOnHover = store.getBoolean(IPreferenceConstants.SELECT_ON_HOVER); >- boolean openAfterDelay = store.getBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); >- int singleClickMethod = openOnSingleClick ? OpenStrategy.SINGLE_CLICK : OpenStrategy.DOUBLE_CLICK; >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); >+ boolean openOnSingleClick = >+ store.getBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); >+ boolean selectOnHover = >+ store.getBoolean(IPreferenceConstants.SELECT_ON_HOVER); >+ boolean openAfterDelay = >+ store.getBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); >+ int singleClickMethod = >+ openOnSingleClick >+ ? OpenStrategy.SINGLE_CLICK >+ : OpenStrategy.DOUBLE_CLICK; > if (openOnSingleClick) { > if (selectOnHover) > singleClickMethod |= OpenStrategy.SELECT_ON_HOVER; >@@ -972,7 +955,8 @@ > * Initialize the workbench fonts with the stored values. > */ > private void initializeFonts() { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); > FontRegistry registry = JFaceResources.getFontRegistry(); > > //Iterate through the definitions and initialize thier >@@ -984,37 +968,42 @@ > String fontKey = definition.getId(); > initializeFont(fontKey, registry, store); > String defaultsTo = definitions[i].getDefaultsTo(); >- if (defaultsTo != null){ >+ if (defaultsTo != null) { > PreferenceConverter.setDefault( > store, > definition.getId(), >- PreferenceConverter. >- getDefaultFontDataArray(store,defaultsTo)); >- >+ PreferenceConverter.getDefaultFontDataArray( >+ store, >+ defaultsTo)); >+ > //If there is no value in the registry pass though the mapping >- if(!registry.hasValueFor(fontKey)) >+ if (!registry.hasValueFor(fontKey)) > fontsToSet.add(definition); > } > } >- >- >+ > /** > * Now that all of the font have been initialized anything > * that is still at its defaults and has a defaults to > * needs to have its value set in the registry. > * Post process to be sure that all of the fonts have the correct > * setting before there is an update. >- */ >+ */ > Iterator updateIterator = fontsToSet.iterator(); >- while(updateIterator.hasNext()){ >+ while (updateIterator.hasNext()) { > FontDefinition update = (FontDefinition) updateIterator.next(); >- registry.put(update.getId(),registry.getFontData(update.getDefaultsTo())); >+ registry.put( >+ update.getId(), >+ registry.getFontData(update.getDefaultsTo())); > } > } > /** > * Initialize the specified font with the stored value. > */ >- private void initializeFont(String fontKey, FontRegistry registry, IPreferenceStore store) { >+ private void initializeFont( >+ String fontKey, >+ FontRegistry registry, >+ IPreferenceStore store) { > if (store.isDefault(fontKey)) > return; > FontData[] font = PreferenceConverter.getFontDataArray(store, fontKey); >@@ -1024,16 +1013,23 @@ > * Initialize the product image obtained from the product info file > */ > private void initializeProductImage() { >- ImageDescriptor descriptor = getConfigurationInfo().getAboutInfo().getWindowImage(); >+ ImageDescriptor descriptor = >+ getConfigurationInfo().getAboutInfo().getWindowImage(); > if (descriptor != null) { >- WorkbenchImages.getImageRegistry().put(IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD, descriptor); >- Image image = WorkbenchImages.getImage(IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD); >+ WorkbenchImages.getImageRegistry().put( >+ IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD, >+ descriptor); >+ Image image = >+ WorkbenchImages.getImage( >+ IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD); > if (image != null) { > Window.setDefaultImage(image); > } > } else { > // Avoid setting a missing image as the window default image >- WorkbenchImages.getImageRegistry().put(IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD, ImageDescriptor.getMissingImageDescriptor()); >+ WorkbenchImages.getImageRegistry().put( >+ IWorkbenchGraphicConstants.IMG_OBJS_DEFAULT_PROD, >+ ImageDescriptor.getMissingImageDescriptor()); > } > } > /** >@@ -1048,16 +1044,16 @@ > public boolean isStarting() { > return isStarting; > } >- >- /** >- * Creates a new workbench window. >- * >- * @return the new workbench window >- */ >- protected WorkbenchWindow newWorkbenchWindow() { >- return new WorkbenchWindow(this, getNewWindowNumber()); >+ >+ /** >+ * Creates a new workbench window. >+ * >+ * @return the new workbench window >+ */ >+ protected WorkbenchWindow newWorkbenchWindow() { >+ return new WorkbenchWindow(this, getNewWindowNumber()); > } >- >+ > /** > * Create the initial workbench window. > * @return true if the open succeeds >@@ -1071,14 +1067,16 @@ > // Create the initial page. > try { > IContainer root = WorkbenchPlugin.getPluginWorkspace().getRoot(); >- newWindow.openPage(getPerspectiveRegistry().getDefaultPerspective(), root); >+ newWindow.openPage( >+ getPerspectiveRegistry().getDefaultPerspective(), >+ root); > } catch (WorkbenchException e) { > ErrorDialog.openError(newWindow.getShell(), WorkbenchMessages.getString("Problems_Opening_Page"), //$NON-NLS-1$ > e.getMessage(), e.getStatus()); > } > newWindow.open(); > } >- >+ > /** > * Create the workbench UI from a persistence file. > */ >@@ -1097,7 +1095,8 @@ > IMemento memento = XMLMemento.createReadRoot(reader); > > // Validate known version format >- String version = memento.getString(IWorkbenchConstants.TAG_VERSION); >+ String version = >+ memento.getString(IWorkbenchConstants.TAG_VERSION); > boolean valid = false; > for (int i = 0; i < VERSION_STRING.length; i++) { > if (VERSION_STRING[i].equals(version)) { >@@ -1107,9 +1106,7 @@ > } > if (!valid) { > reader.close(); >- MessageDialog.openError( >- (Shell) null, >- WorkbenchMessages.getString("Restoring_Problems"), //$NON-NLS-1$ >+ MessageDialog.openError((Shell) null, WorkbenchMessages.getString("Restoring_Problems"), //$NON-NLS-1$ > WorkbenchMessages.getString("Invalid_workbench_state_ve")); //$NON-NLS-1$ > stateFile.delete(); > result[0] = RESTORE_CODE_RESET; >@@ -1120,14 +1117,14 @@ > // We no longer support the release 1.0 format > if (VERSION_STRING[0].equals(version)) { > reader.close(); >- boolean ignoreSavedState = new MessageDialog( >- null, >- WorkbenchMessages.getString("Workbench.incompatibleUIState"), //$NON-NLS-1$ >- null, >- WorkbenchMessages.getString("Workbench.incompatibleSavedStateVersion"), //$NON-NLS-1$ >- MessageDialog.WARNING, >- new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, >- 0).open() == 0; // OK is the default >+ boolean ignoreSavedState = new MessageDialog(null, WorkbenchMessages.getString("Workbench.incompatibleUIState"), //$NON-NLS-1$ >+ null, WorkbenchMessages.getString("Workbench.incompatibleSavedStateVersion"), //$NON-NLS-1$ >+ MessageDialog.WARNING, >+ new String[] { >+ IDialogConstants.OK_LABEL, >+ IDialogConstants.CANCEL_LABEL }, >+ 0).open() == 0; >+ // OK is the default > if (ignoreSavedState) { > stateFile.delete(); > result[0] = RESTORE_CODE_RESET; >@@ -1141,11 +1138,9 @@ > IStatus restoreResult = restoreState(memento); > reader.close(); > if (restoreResult.getSeverity() == IStatus.ERROR) { >- ErrorDialog.openError( >- null, >- WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >- WorkbenchMessages.getString("Workbench.problemsRestoringMsg"), //$NON-NLS-1$ >- restoreResult); >+ ErrorDialog.openError(null, WorkbenchMessages.getString("Workspace.problemsTitle"), //$NON-NLS-1$ >+ WorkbenchMessages.getString("Workbench.problemsRestoringMsg"), //$NON-NLS-1$ >+ restoreResult); > } > } > public void handleException(Throwable e) { >@@ -1156,20 +1151,27 @@ > > }); > // ensure at least one window was opened >- if (result[0] == RESTORE_CODE_OK && windowManager.getWindows().length == 0) >+ if (result[0] == RESTORE_CODE_OK >+ && windowManager.getWindows().length == 0) > result[0] = RESTORE_CODE_RESET; > return result[0]; > } > /** > * Opens a new window and page with the default perspective. > */ >- public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) throws WorkbenchException { >- return openWorkbenchWindow(getPerspectiveRegistry().getDefaultPerspective(), input); >+ public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) >+ throws WorkbenchException { >+ return openWorkbenchWindow( >+ getPerspectiveRegistry().getDefaultPerspective(), >+ input); > } > /** > * Opens a new workbench window and page with a specific perspective. > */ >- public IWorkbenchWindow openWorkbenchWindow(final String perspID, final IAdaptable input) throws WorkbenchException { >+ public IWorkbenchWindow openWorkbenchWindow( >+ final String perspID, >+ final IAdaptable input) >+ throws WorkbenchException { > // Run op in busy cursor. > final Object[] result = new Object[1]; > BusyIndicator.showWhile(null, new Runnable() { >@@ -1201,11 +1203,11 @@ > * Record the workbench UI in a document > */ > private XMLMemento recordWorkbenchState() { >- XMLMemento memento = XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKBENCH); >+ XMLMemento memento = >+ XMLMemento.createWriteRoot(IWorkbenchConstants.TAG_WORKBENCH); > IStatus status = saveState(memento); > if (status.getSeverity() != IStatus.OK) { >- ErrorDialog.openError((Shell)null, >- WorkbenchMessages.getString("Workbench.problemsSaving"), //$NON-NLS-1$ >+ ErrorDialog.openError((Shell) null, WorkbenchMessages.getString("Workbench.problemsSaving"), //$NON-NLS-1$ > WorkbenchMessages.getString("Workbench.problemsSavingMsg"), //$NON-NLS-1$ > status); > } >@@ -1215,42 +1217,45 @@ > * Method declared on IWorkbench. > */ > public boolean restart() { >- return close(EXIT_RESTART); // this is the return code from run() to trigger a restart >+ return close(EXIT_RESTART); >+ // this is the return code from run() to trigger a restart > } > /** > * Restores the state of the previously saved workbench > */ > private IStatus restoreState(IMemento memento) { > >- MultiStatus result = new MultiStatus( >- PlatformUI.PLUGIN_ID,IStatus.OK, >- WorkbenchMessages.getString("Workbench.problemsRestoring"),null); //$NON-NLS-1$ >+ MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.getString("Workbench.problemsRestoring"), null); //$NON-NLS-1$ > // Read perspective history. > // This must be done before we recreate the windows, because it is > // consulted during the recreation. > IMemento childMem; > try { >- UIStats.start(UIStats.RESTORE_WORKBENCH,"PerspectiveHistory"); //$NON-NLS-1$ >- childMem = memento.getChild(IWorkbenchConstants.TAG_PERSPECTIVE_HISTORY); >+ UIStats.start(UIStats.RESTORE_WORKBENCH, "PerspectiveHistory"); //$NON-NLS-1$ >+ childMem = >+ memento.getChild(IWorkbenchConstants.TAG_PERSPECTIVE_HISTORY); > if (childMem != null) > result.add(getPerspectiveHistory().restoreState(childMem)); > } finally { >- UIStats.end(UIStats.RESTORE_WORKBENCH,"PerspectiveHistory"); //$NON-NLS-1$ >+ UIStats.end(UIStats.RESTORE_WORKBENCH, "PerspectiveHistory"); //$NON-NLS-1$ > } > try { >- UIStats.start(UIStats.RESTORE_WORKBENCH,"MRUList"); //$NON-NLS-1$ >+ UIStats.start(UIStats.RESTORE_WORKBENCH, "MRUList"); //$NON-NLS-1$ > IMemento mruMemento = memento.getChild(IWorkbenchConstants.TAG_MRU_LIST); //$NON-NLS-1$ > if (mruMemento != null) { > result.add(getEditorHistory().restoreState(mruMemento)); > } > } finally { >- UIStats.end(UIStats.RESTORE_WORKBENCH,"MRUList"); //$NON-NLS-1$ >+ UIStats.end(UIStats.RESTORE_WORKBENCH, "MRUList"); //$NON-NLS-1$ > } > // Get the child windows. >- IMemento[] children = memento.getChildren(IWorkbenchConstants.TAG_WINDOW); >- IPerspectiveRegistry reg = WorkbenchPlugin.getDefault().getPerspectiveRegistry(); >+ IMemento[] children = >+ memento.getChildren(IWorkbenchConstants.TAG_WINDOW); >+ IPerspectiveRegistry reg = >+ WorkbenchPlugin.getDefault().getPerspectiveRegistry(); > >- AboutInfo newFeaturesWithPerspectives[] = getConfigurationInfo().collectNewFeaturesWithPerspectives(); >+ AboutInfo newFeaturesWithPerspectives[] = >+ getConfigurationInfo().collectNewFeaturesWithPerspectives(); > // Read the workbench windows. > for (int x = 0; x < children.length; x++) { > childMem = children[x]; >@@ -1258,7 +1263,9 @@ > newWindow.create(); > IPerspectiveDescriptor desc = null; > if (x < newFeaturesWithPerspectives.length) >- desc = reg.findPerspectiveWithId(newFeaturesWithPerspectives[x].getWelcomePerspective()); >+ desc = >+ reg.findPerspectiveWithId( >+ newFeaturesWithPerspectives[x].getWelcomePerspective()); > > result.merge(newWindow.restoreState(childMem, desc)); > if (desc != null) { >@@ -1269,9 +1276,14 @@ > page = pages[0]; > } > if (page == null) { >- IContainer root = WorkbenchPlugin.getPluginWorkspace().getRoot(); >+ IContainer root = >+ WorkbenchPlugin.getPluginWorkspace().getRoot(); > try { >- page = (WorkbenchPage) newWindow.openPage(newFeaturesWithPerspectives[x].getWelcomePerspective(), root); >+ page = >+ (WorkbenchPage) newWindow.openPage( >+ newFeaturesWithPerspectives[x] >+ .getWelcomePerspective(), >+ root); > } catch (WorkbenchException e) { > result.add(e.getStatus()); > } >@@ -1280,7 +1292,10 @@ > } > newWindow.setActivePage(page); > try { >- page.openEditor(new WelcomeEditorInput(newFeaturesWithPerspectives[x]), WELCOME_EDITOR_ID, true); >+ page.openEditor( >+ new WelcomeEditorInput(newFeaturesWithPerspectives[x]), >+ WELCOME_EDITOR_ID, >+ true); > } catch (PartInitException e) { > result.add(e.getStatus()); > } >@@ -1299,7 +1314,8 @@ > String pluginId = "org.eclipse.ui"; //$NON-NLS-1$ > String extensionPoint = "startup"; //$NON-NLS-1$ > >- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint); >+ IExtensionPoint point = >+ registry.getExtensionPoint(pluginId, extensionPoint); > IExtension[] extensions = point.getExtensions(); > IPluginDescriptor result[] = new IPluginDescriptor[extensions.length]; > for (int i = 0; i < extensions.length; i++) { >@@ -1313,14 +1329,18 @@ > protected void startPlugins() { > Runnable work = new Runnable() { > IPreferenceStore store = getPreferenceStore(); >- final String pref = store.getString(IPreferenceConstants.PLUGINS_NOT_ACTIVATED_ON_STARTUP); >+ final String pref = >+ store.getString( >+ IPreferenceConstants.PLUGINS_NOT_ACTIVATED_ON_STARTUP); > public void run() { > IPluginDescriptor descriptors[] = getEarlyActivatedPlugins(); > for (int i = 0; i < descriptors.length; i++) { > final IPluginDescriptor pluginDescriptor = descriptors[i]; > SafeRunnable code = new SafeRunnable() { > public void run() throws Exception { >- String id = pluginDescriptor.getUniqueIdentifier() + IPreferenceConstants.SEPARATOR; >+ String id = >+ pluginDescriptor.getUniqueIdentifier() >+ + IPreferenceConstants.SEPARATOR; > if (pref.indexOf(id) < 0) { > Plugin plugin = pluginDescriptor.getPlugin(); > IStartup startup = (IStartup) plugin; >@@ -1343,7 +1363,7 @@ > * Runs the workbench. > */ > public Object run(Object arg) { >- UIStats.start(UIStats.START_WORKBENCH,"Workbench"); //$NON-NLS-1$ >+ UIStats.start(UIStats.START_WORKBENCH, "Workbench"); //$NON-NLS-1$ > String[] commandLineArgs = new String[0]; > if (arg != null && arg instanceof String[]) > commandLineArgs = (String[]) arg; >@@ -1379,7 +1399,7 @@ > startPlugins(); > display.asyncExec(new Runnable() { > public void run() { >- UIStats.end(UIStats.START_WORKBENCH,"Workbench"); //$NON-NLS-1$ >+ UIStats.end(UIStats.START_WORKBENCH, "Workbench"); //$NON-NLS-1$ > } > }); > runEventLoop(handler); >@@ -1410,9 +1430,7 @@ > * Saves the current state of the workbench so it can be restored later on > */ > private IStatus saveState(IMemento memento) { >- MultiStatus result = new MultiStatus( >- PlatformUI.PLUGIN_ID,IStatus.OK, >- WorkbenchMessages.getString("Workbench.problemsSaving"),null); //$NON-NLS-1$ >+ MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, WorkbenchMessages.getString("Workbench.problemsSaving"), null); //$NON-NLS-1$ > > // Save the version number. > memento.putString(IWorkbenchConstants.TAG_VERSION, VERSION_STRING[1]); >@@ -1421,7 +1439,8 @@ > IWorkbenchWindow[] windows = getWorkbenchWindows(); > for (int nX = 0; nX < windows.length; nX++) { > WorkbenchWindow window = (WorkbenchWindow) windows[nX]; >- IMemento childMem = memento.createChild(IWorkbenchConstants.TAG_WINDOW); >+ IMemento childMem = >+ memento.createChild(IWorkbenchConstants.TAG_WINDOW); > result.merge(window.saveState(childMem)); > } > result.add(getEditorHistory().saveState(memento.createChild(IWorkbenchConstants.TAG_MRU_LIST))); //$NON-NLS-1$ >@@ -1454,12 +1473,18 @@ > /** > * @see IExecutableExtension > */ >- public void setInitializationData(IConfigurationElement configElement, String propertyName, Object data) { >+ public void setInitializationData( >+ IConfigurationElement configElement, >+ String propertyName, >+ Object data) { > } > /* (non-Javadoc) > * Method declared on IWorkbench. > */ >- public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException { >+ public IWorkbenchPage showPerspective( >+ String perspectiveId, >+ IWorkbenchWindow window) >+ throws WorkbenchException { > Assert.isNotNull(perspectiveId); > > // If the specified window has the requested perspective open, then the window >@@ -1468,7 +1493,8 @@ > if (win != null) { > WorkbenchPage page = win.getActiveWorkbenchPage(); > if (page != null) { >- IPerspectiveDescriptor perspectives[] = page.getOpenedPerspectives(); >+ IPerspectiveDescriptor perspectives[] = >+ page.getOpenedPerspectives(); > for (int i = 0; i < perspectives.length; i++) { > IPerspectiveDescriptor persp = perspectives[i]; > if (perspectiveId.equals(persp.getId())) { >@@ -1499,7 +1525,7 @@ > if (perspectiveId.equals(persp.getDesc().getId())) { > Shell shell = win.getShell(); > shell.open(); >- if(shell.getMinimized()) >+ if (shell.getMinimized()) > shell.setMinimized(false); > return page; > } >@@ -1513,7 +1539,8 @@ > // perspectives, and that window is given focus. > win = (WorkbenchWindow) window; > if (win != null) { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); > int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); > IWorkbenchPage page = win.getActiveWorkbenchPage(); > IPerspectiveDescriptor persp = null; >@@ -1523,10 +1550,13 @@ > // Only open a new window if user preference is set and the window > // has an active perspective. > if (IPreferenceConstants.OPM_NEW_WINDOW == mode && persp != null) { >- IWorkbenchWindow newWindow = openWorkbenchWindow(perspectiveId, input); >+ IWorkbenchWindow newWindow = >+ openWorkbenchWindow(perspectiveId, input); > return newWindow.getActivePage(); > } else { >- IPerspectiveDescriptor desc = getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); >+ IPerspectiveDescriptor desc = >+ getPerspectiveRegistry().findPerspectiveWithId( >+ perspectiveId); > if (desc == null) > throw new WorkbenchException(WorkbenchMessages.getString("WorkbenchPage.ErrorRecreatingPerspective")); //$NON-NLS-1$ > win.getShell().open(); >@@ -1545,7 +1575,11 @@ > /* (non-Javadoc) > * Method declared on IWorkbench. > */ >- public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException { >+ public IWorkbenchPage showPerspective( >+ String perspectiveId, >+ IWorkbenchWindow window, >+ IAdaptable input) >+ throws WorkbenchException { > Assert.isNotNull(perspectiveId); > > // If the specified window has the requested perspective open and the same requested >@@ -1562,7 +1596,8 @@ > inputSame = input.equals(page.getInput()); > if (inputSame) { > inputSameAsWindow = true; >- IPerspectiveDescriptor perspectives[] = page.getOpenedPerspectives(); >+ IPerspectiveDescriptor perspectives[] = >+ page.getOpenedPerspectives(); > for (int i = 0; i < perspectives.length; i++) { > IPerspectiveDescriptor persp = perspectives[i]; > if (perspectiveId.equals(persp.getId())) { >@@ -1604,12 +1639,15 @@ > // on condition that the user preference is not to open perspectives in a new window. > win = (WorkbenchWindow) window; > if (inputSameAsWindow && win != null) { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); > int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); > > if (IPreferenceConstants.OPM_NEW_WINDOW != mode) { > IWorkbenchPage page = win.getActiveWorkbenchPage(); >- IPerspectiveDescriptor desc = getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); >+ IPerspectiveDescriptor desc = >+ getPerspectiveRegistry().findPerspectiveWithId( >+ perspectiveId); > if (desc == null) > throw new WorkbenchException(WorkbenchMessages.getString("WorkbenchPage.ErrorRecreatingPerspective")); //$NON-NLS-1$ > win.getShell().open(); >@@ -1629,7 +1667,9 @@ > if (page != null) > persp = page.getPerspective(); > if (persp == null) { >- IPerspectiveDescriptor desc = getPerspectiveRegistry().findPerspectiveWithId(perspectiveId); >+ IPerspectiveDescriptor desc = >+ getPerspectiveRegistry().findPerspectiveWithId( >+ perspectiveId); > if (desc == null) > throw new WorkbenchException(WorkbenchMessages.getString("WorkbenchPage.ErrorRecreatingPerspective")); //$NON-NLS-1$ > win.getShell().open(); >@@ -1653,8 +1693,8 @@ > private void shutdown() { > WorkbenchColors.shutdown(); > JFaceColors.disposeColors(); >- if(getDecoratorManager() != null) >- ((DecoratorManager) getDecoratorManager()).shutdown(); >+ if (getDecoratorManager() != null) >+ ((DecoratorManager) getDecoratorManager()).shutdown(); > } > > /** >@@ -1685,10 +1725,10 @@ > return activatedWindow; > } > } >- >+ > return null; > } >- >+ > /** > * Sets the workbench window which was last known being the > * active one, or <code>null</code>. >@@ -1709,9 +1749,13 @@ > Window[] wins = windowManager.getWindows(); > for (int i = 0; i < wins.length; i++) { > if (autoBuildSetting) { >- ((WorkbenchWindow)wins[i]).getActionBuilder().removeManualIncrementalBuildAction(); >+ ((WorkbenchWindow) wins[i]) >+ .getActionBuilder() >+ .removeManualIncrementalBuildAction(); > } else { >- ((WorkbenchWindow)wins[i]).getActionBuilder().addManualIncrementalBuildAction(); >+ ((WorkbenchWindow) wins[i]) >+ .getActionBuilder() >+ .addManualIncrementalBuildAction(); > } > } > } >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java,v >retrieving revision 1.35 >diff -u -r1.35 WorkbenchPlugin.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java 19 Mar 2003 02:58:52 -0000 1.35 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java 8 Apr 2003 17:08:08 -0000 >@@ -401,7 +401,6 @@ > protected void initializeDefaultPreferences(IPreferenceStore store) { > > JFacePreferences.setPreferenceStore(store); >- store.setDefault(IPreferenceConstants.AUTO_BUILD, true); > store.setDefault(IPreferenceConstants.SAVE_ALL_BEFORE_BUILD, false); > store.setDefault(IPreferenceConstants.SAVE_INTERVAL, 5); //5 minutes > store.setDefault(IPreferenceConstants.WELCOME_DIALOG, true); >Index: Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java,v >retrieving revision 1.18 >diff -u -r1.18 WorkbenchPreferencePage.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java 10 Mar 2003 22:09:27 -0000 1.18 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java 8 Apr 2003 17:08:08 -0000 >@@ -22,11 +22,14 @@ > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.*; >-import org.eclipse.ui.*; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.IWorkbenchPreferencePage; > import org.eclipse.ui.help.WorkbenchHelp; > import org.eclipse.ui.internal.*; > >-public class WorkbenchPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { >+public class WorkbenchPreferencePage >+ extends PreferencePage >+ implements IWorkbenchPreferencePage { > private IWorkbench workbench; > private Button autoBuildButton; > private Button autoSaveAllButton; >@@ -50,17 +53,21 @@ > * @param parent org.eclipse.swt.widgets.Composite > */ > protected Control createContents(Composite parent) { >- >+ > Font font = parent.getFont(); > >- WorkbenchHelp.setHelp(parent, IHelpContextIds.WORKBENCH_PREFERENCE_PAGE); >+ WorkbenchHelp.setHelp( >+ parent, >+ IHelpContextIds.WORKBENCH_PREFERENCE_PAGE); > > Composite composite = new Composite(parent, SWT.NULL); > GridLayout layout = new GridLayout(); > layout.marginWidth = 0; > layout.marginHeight = 0; > composite.setLayout(layout); >- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); >+ composite.setLayoutData( >+ new GridData( >+ GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); > composite.setFont(font); > > autoBuildButton = new Button(composite, SWT.CHECK); >@@ -74,47 +81,56 @@ > refreshButton = new Button(composite, SWT.CHECK); > refreshButton.setText(WorkbenchMessages.getString("WorkbenchPreference.refreshButton")); //$NON-NLS-1$ > refreshButton.setFont(font); >- >+ > exitPromptButton = new Button(composite, SWT.CHECK); > exitPromptButton.setText(WorkbenchMessages.getString("WorkbenchPreference.exitPromptButton")); //$NON-NLS-1$ > exitPromptButton.setFont(font); >- >+ > showTasks = new Button(composite, SWT.CHECK); > showTasks.setText(WorkbenchMessages.getString("WorkbenchPreference.showTasks")); //$NON-NLS-1$ > showTasks.setFont(font); > > createSpace(composite); > createSaveIntervalGroup(composite); >- >+ > createSpace(composite); > createSingleClickGroup(composite); > > // set initial values >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- autoBuildButton.setSelection(ResourcesPlugin.getWorkspace().isAutoBuilding()); >- autoSaveAllButton.setSelection(store.getBoolean(IPreferenceConstants.SAVE_ALL_BEFORE_BUILD)); >- refreshButton.setSelection(store.getBoolean(IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP)); >- exitPromptButton.setSelection(store.getBoolean(IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW)); >- showTasks.setSelection(store.getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)); >- >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); >+ autoBuildButton.setSelection( >+ ResourcesPlugin.getWorkspace().isAutoBuilding()); >+ autoSaveAllButton.setSelection( >+ store.getBoolean(IPreferenceConstants.SAVE_ALL_BEFORE_BUILD)); >+ refreshButton.setSelection( >+ store.getBoolean( >+ IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP)); >+ exitPromptButton.setSelection( >+ store.getBoolean( >+ IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW)); >+ showTasks.setSelection( >+ store.getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)); >+ > return composite; > } >- >+ > private void createSingleClickGroup(Composite composite) { >- >+ > Font font = composite.getFont(); >- >+ > Group buttonComposite = new Group(composite, SWT.LEFT); > GridLayout layout = new GridLayout(); > buttonComposite.setLayout(layout); >- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); >+ GridData data = >+ new GridData( >+ GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); > buttonComposite.setLayoutData(data); > buttonComposite.setText(WorkbenchMessages.getString("WorkbenchPreference.openMode")); //$NON-NLS-1$ > buttonComposite.setFont(font); >- > > String label = WorkbenchMessages.getString("WorkbenchPreference.doubleClick"); //$NON-NLS-1$ >- doubleClickButton = createRadioButton(buttonComposite,label); >+ doubleClickButton = createRadioButton(buttonComposite, label); > doubleClickButton.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { > selectClickMode(singleClickButton.getSelection()); >@@ -123,14 +139,14 @@ > doubleClickButton.setSelection(!openOnSingleClick); > > label = WorkbenchMessages.getString("WorkbenchPreference.singleClick"); //$NON-NLS-1$ >- singleClickButton = createRadioButton(buttonComposite,label); >+ singleClickButton = createRadioButton(buttonComposite, label); > singleClickButton.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { > selectClickMode(singleClickButton.getSelection()); > } > }); > singleClickButton.setSelection(openOnSingleClick); >- >+ > label = WorkbenchMessages.getString("WorkbenchPreference.singleClick_SelectOnHover"); //$NON-NLS-1$ > selectOnHoverButton = new Button(buttonComposite, SWT.CHECK | SWT.LEFT); > selectOnHoverButton.setText(label); >@@ -145,10 +161,10 @@ > data = new GridData(); > data.horizontalIndent = 20; > selectOnHoverButton.setLayoutData(data); >- >- >+ > label = WorkbenchMessages.getString("WorkbenchPreference.singleClick_OpenAfterDelay"); //$NON-NLS-1$ >- openAfterDelayButton = new Button(buttonComposite, SWT.CHECK | SWT.LEFT); >+ openAfterDelayButton = >+ new Button(buttonComposite, SWT.CHECK | SWT.LEFT); > openAfterDelayButton.setText(label); > openAfterDelayButton.setEnabled(openOnSingleClick); > openAfterDelayButton.setSelection(openAfterDelay); >@@ -157,23 +173,24 @@ > public void widgetSelected(SelectionEvent e) { > openAfterDelay = openAfterDelayButton.getSelection(); > } >- }); >+ }); > data = new GridData(); > data.horizontalIndent = 20; > openAfterDelayButton.setLayoutData(data); >- >+ > createNoteComposite( > font, > buttonComposite, >- WorkbenchMessages.getString("Preference.note"),//$NON-NLS-1$ >- WorkbenchMessages.getString("WorkbenchPreference.noEffectOnAllViews")); //$NON-NLS-1$ >+ WorkbenchMessages.getString("Preference.note"), >+ //$NON-NLS-1$ >+ WorkbenchMessages.getString("WorkbenchPreference.noEffectOnAllViews")); //$NON-NLS-1$ > } >- >+ > private void selectClickMode(boolean singleClick) { > openOnSingleClick = singleClick; > selectOnHoverButton.setEnabled(openOnSingleClick); > openAfterDelayButton.setEnabled(openOnSingleClick); >- } >+ } > /** > * Create a composite that contains entry fields specifying save interval preference. > */ >@@ -185,30 +202,34 @@ > GridData gd = new GridData(); > gd.horizontalAlignment = GridData.FILL; > gd.grabExcessHorizontalSpace = true; >- groupComposite.setLayoutData(gd); >+ groupComposite.setLayoutData(gd); > groupComposite.setFont(composite.getFont()); >- >+ > saveInterval = new IntegerFieldEditor(IPreferenceConstants.SAVE_INTERVAL, WorkbenchMessages.getString("WorkbenchPreference.saveInterval"), groupComposite); //$NON-NLS-1$ > >- saveInterval.setPreferenceStore(WorkbenchPlugin.getDefault().getPreferenceStore()); >+ saveInterval.setPreferenceStore( >+ WorkbenchPlugin.getDefault().getPreferenceStore()); > saveInterval.setPreferencePage(this); >- saveInterval.setTextLimit(Integer.toString(IPreferenceConstants.MAX_SAVE_INTERVAL).length()); >+ saveInterval.setTextLimit( >+ Integer.toString(IPreferenceConstants.MAX_SAVE_INTERVAL).length()); > saveInterval.setErrorMessage(WorkbenchMessages.format("WorkbenchPreference.saveIntervalError", new Object[] { new Integer(IPreferenceConstants.MAX_SAVE_INTERVAL)})); //$NON-NLS-1$ >- saveInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); >+ saveInterval.setValidateStrategy( >+ StringFieldEditor.VALIDATE_ON_KEY_STROKE); > saveInterval.setValidRange(1, IPreferenceConstants.MAX_SAVE_INTERVAL); > >- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); >+ IWorkspaceDescription description = >+ ResourcesPlugin.getWorkspace().getDescription(); > long interval = description.getSnapshotInterval() / 60000; > saveInterval.setStringValue(Long.toString(interval)); > > saveInterval.setPropertyChangeListener(new IPropertyChangeListener() { > public void propertyChange(PropertyChangeEvent event) { >- if (event.getProperty().equals(FieldEditor.IS_VALID)) >+ if (event.getProperty().equals(FieldEditor.IS_VALID)) > setValid(saveInterval.isValid()); > } > }); >- >- } >+ >+ } > /** > * Utility method that creates a radio button instance > * and sets the default layout data. >@@ -283,7 +304,8 @@ > */ > public void init(IWorkbench aWorkbench) { > workbench = aWorkbench; >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); > openOnSingleClick = store.getBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); //$NON-NLS-1$ > selectOnHover = store.getBoolean(IPreferenceConstants.SELECT_ON_HOVER); //$NON-NLS-1$ > openAfterDelay = store.getBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); //$NON-NLS-1$ >@@ -292,14 +314,28 @@ > * The default button has been pressed. > */ > protected void performDefaults() { >- IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore(); >- autoBuildButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.AUTO_BUILD)); >- autoSaveAllButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.SAVE_ALL_BEFORE_BUILD)); >- refreshButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP)); >- exitPromptButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW)); >- showTasks.setSelection(store.getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)); >+ >+ autoBuildButton.setSelection( >+ ResourcesPlugin >+ .getPlugin() >+ .getPluginPreferences() >+ .getDefaultBoolean( >+ ResourcesPlugin.PREF_AUTO_BUILDING)); >+ IPreferenceStore store = >+ WorkbenchPlugin.getDefault().getPreferenceStore(); >+ autoSaveAllButton.setSelection( >+ store.getDefaultBoolean( >+ IPreferenceConstants.SAVE_ALL_BEFORE_BUILD)); >+ refreshButton.setSelection( >+ store.getDefaultBoolean( >+ IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP)); >+ exitPromptButton.setSelection( >+ store.getDefaultBoolean( >+ IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW)); >+ showTasks.setSelection( >+ store.getBoolean(IPreferenceConstants.SHOW_TASKS_ON_BUILD)); > saveInterval.loadDefault(); >- >+ > openOnSingleClick = store.getDefaultBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); //$NON-NLS-1$ > selectOnHover = store.getDefaultBoolean(IPreferenceConstants.SELECT_ON_HOVER); //$NON-NLS-1$ > openAfterDelay = store.getDefaultBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); //$NON-NLS-1$ >@@ -308,8 +344,8 @@ > selectOnHoverButton.setSelection(selectOnHover); > openAfterDelayButton.setSelection(openAfterDelay); > selectOnHoverButton.setEnabled(openOnSingleClick); >- openAfterDelayButton.setEnabled(openOnSingleClick); >- >+ openAfterDelayButton.setEnabled(openOnSingleClick); >+ > super.performDefaults(); > } > /** >@@ -318,54 +354,77 @@ > public boolean performOk() { > IPreferenceStore store = getPreferenceStore(); > >- // inform the workbench of whether it should do autobuilds or not >- IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription(); >- boolean coreAutoBuildSetting = description.isAutoBuilding(); >- boolean preferenceStoreCurrentSetting = store.getBoolean(IPreferenceConstants.AUTO_BUILD); > boolean newAutoBuildSetting = autoBuildButton.getSelection(); >- >- //As older versions of Eclipse did not use the preference store for this >- //setting it is possible that the setting in Core will be false >- //and the preference store will have the default value of true. >- //Do a second setValue if required here to synch them up >- if(preferenceStoreCurrentSetting && !coreAutoBuildSetting) >- store.setValue(IPreferenceConstants.AUTO_BUILD, coreAutoBuildSetting); >- >- // store the auto build in the preference store so that we can enable import and export >- store.setValue(IPreferenceConstants.AUTO_BUILD, newAutoBuildSetting); >+ >+ // inform the workbench of whether it should do autobuilds or not >+ IWorkspace workspace = ResourcesPlugin.getWorkspace(); >+ IWorkspaceDescription description = >+ ResourcesPlugin.getWorkspace().getDescription(); >+ boolean oldBuildSetting = description.isAutoBuilding(); >+ if (newAutoBuildSetting != oldBuildSetting) { >+ description.setAutoBuilding(newAutoBuildSetting); >+ try { >+ workspace.setDescription(description); >+ } catch (CoreException exception) { >+ //If we can't set the description abort. >+ return false; >+ } >+ //Fire a property changed event to anyone is who is >+ //listening to our store >+ store.firePropertyChangeEvent( >+ ResourcesPlugin.PREF_AUTO_BUILDING, >+ String.valueOf(oldBuildSetting), >+ String.valueOf(newAutoBuildSetting)); >+ >+ } > > // store the save all prior to build setting >- store.setValue(IPreferenceConstants.SAVE_ALL_BEFORE_BUILD, autoSaveAllButton.getSelection()); >+ store.setValue( >+ IPreferenceConstants.SAVE_ALL_BEFORE_BUILD, >+ autoSaveAllButton.getSelection()); > > // store the refresh workspace on startup setting >- store.setValue(IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP, refreshButton.getSelection()); >+ store.setValue( >+ IPreferenceConstants.REFRESH_WORKSPACE_ON_STARTUP, >+ refreshButton.getSelection()); > > // store the exit prompt on last window close setting >- store.setValue(IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW, exitPromptButton.getSelection()); >+ store.setValue( >+ IPreferenceConstants.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW, >+ exitPromptButton.getSelection()); > > //store the preference for bringing task view to front on build >- store.setValue(IPreferenceConstants.SHOW_TASKS_ON_BUILD, showTasks.getSelection()); >+ store.setValue( >+ IPreferenceConstants.SHOW_TASKS_ON_BUILD, >+ showTasks.getSelection()); > > long oldSaveInterval = description.getSnapshotInterval() / 60000; >- long newSaveInterval = new Long(saveInterval.getStringValue()).longValue(); >- if(oldSaveInterval != newSaveInterval) { >+ long newSaveInterval = >+ new Long(saveInterval.getStringValue()).longValue(); >+ if (oldSaveInterval != newSaveInterval) { > try { > description.setSnapshotInterval(newSaveInterval * 60000); > ResourcesPlugin.getWorkspace().setDescription(description); >- store.firePropertyChangeEvent(IPreferenceConstants.SAVE_INTERVAL, new Integer((int)oldSaveInterval), new Integer((int)newSaveInterval)); >+ store.firePropertyChangeEvent( >+ IPreferenceConstants.SAVE_INTERVAL, >+ new Integer((int) oldSaveInterval), >+ new Integer((int) newSaveInterval)); > } catch (CoreException e) { > WorkbenchPlugin.log("Error changing save interval preference", e.getStatus()); //$NON-NLS-1$ > } > } > >- store.setValue(IPreferenceConstants.OPEN_ON_SINGLE_CLICK,openOnSingleClick); //$NON-NLS-1$ >- store.setValue(IPreferenceConstants.SELECT_ON_HOVER,selectOnHover); //$NON-NLS-1$ >- store.setValue(IPreferenceConstants.OPEN_AFTER_DELAY,openAfterDelay); //$NON-NLS-1$ >- int singleClickMethod = openOnSingleClick ? OpenStrategy.SINGLE_CLICK : OpenStrategy.DOUBLE_CLICK; >- if(openOnSingleClick) { >- if(selectOnHover) >+ store.setValue(IPreferenceConstants.OPEN_ON_SINGLE_CLICK, openOnSingleClick); //$NON-NLS-1$ >+ store.setValue(IPreferenceConstants.SELECT_ON_HOVER, selectOnHover); //$NON-NLS-1$ >+ store.setValue(IPreferenceConstants.OPEN_AFTER_DELAY, openAfterDelay); //$NON-NLS-1$ >+ int singleClickMethod = >+ openOnSingleClick >+ ? OpenStrategy.SINGLE_CLICK >+ : OpenStrategy.DOUBLE_CLICK; >+ if (openOnSingleClick) { >+ if (selectOnHover) > singleClickMethod |= OpenStrategy.SELECT_ON_HOVER; >- if(openAfterDelay) >+ if (openAfterDelay) > singleClickMethod |= OpenStrategy.ARROW_KEYS_OPEN; > } > OpenStrategy.setOpenMethod(singleClickMethod);
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 36197
: 4500