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 123840 Details for
Bug 261683
query dialog size does not get saved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
temp patch
clipboard.txt (text/plain), 9.50 KB, created by
Thomas Ehrnhoefer
on 2009-01-26 18:29:58 EST
(
hide
)
Description:
temp patch
Filename:
MIME Type:
Creator:
Thomas Ehrnhoefer
Created:
2009-01-26 18:29:58 EST
Size:
9.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage.java,v >retrieving revision 1.20 >diff -u -r1.20 AbstractRepositoryQueryPage.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage.java 4 Dec 2008 05:12:45 -0000 1.20 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositoryQueryPage.java 26 Jan 2009 23:28:10 -0000 >@@ -14,6 +14,8 @@ > import java.util.Set; > > import org.eclipse.core.runtime.Assert; >+import org.eclipse.jface.dialogs.DialogSettings; >+import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.wizard.WizardPage; > import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory; > import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; >@@ -26,8 +28,11 @@ > import org.eclipse.mylyn.tasks.ui.TasksUi; > import org.eclipse.mylyn.tasks.ui.TasksUiImages; > import org.eclipse.search.ui.NewSearchUI; >+import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.plugin.AbstractUIPlugin; > > /** > * Extend to provide repository-specific query page to the Workbench search dialog. >@@ -44,6 +49,17 @@ > > private final IRepositoryQuery query; > >+ // dialog store id constants >+ private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ >+ >+ private static final String X = "x"; //$NON-NLS-1$ >+ >+ private static final String Y = "y"; //$NON-NLS-1$ >+ >+ private static final String WIDTH = "width"; //$NON-NLS-1$ >+ >+ private static final String HEIGHT = "height"; //$NON-NLS-1$ >+ > public AbstractRepositoryQueryPage(String pageName, TaskRepository taskRepository, IRepositoryQuery query) { > super(pageName); > Assert.isNotNull(taskRepository); >@@ -166,4 +182,67 @@ > return taskRepository; > } > >+ @Override >+ public Shell getShell() { >+ Shell shell = null; >+ if (getWizard() != null && getWizard().getContainer() != null) { >+ shell = getWizard().getContainer().getShell(); >+ } >+ if (shell == null && getControl() != null) { >+ shell = getControl().getShell(); >+ } >+ return shell; >+ } >+ >+ protected void saveBounds(AbstractUIPlugin plugin, String pageName) { >+ Shell shell = getShell(); >+ if (shell != null) { >+ Rectangle bounds = shell.getBounds(); >+ IDialogSettings settings = plugin.getDialogSettings(); >+ IDialogSettings pageDialogSettings = settings.getSection(pageName); >+ if (pageDialogSettings == null) { >+ pageDialogSettings = settings.addNewSection(pageName); >+ >+ } >+ IDialogSettings dialogBounds = settings.getSection(DIALOG_BOUNDS_KEY); >+ if (dialogBounds == null) { >+ dialogBounds = new DialogSettings(DIALOG_BOUNDS_KEY); >+ settings.addSection(dialogBounds); >+ } >+ dialogBounds.put(X, bounds.x); >+ dialogBounds.put(Y, bounds.y); >+ dialogBounds.put(WIDTH, bounds.width); >+ dialogBounds.put(HEIGHT, bounds.height); >+ } >+ } >+ >+ protected void restoreBounds(AbstractUIPlugin plugin, String pageName) { >+ Shell shell = getShell(); >+ if (shell != null) { >+ Rectangle bounds = shell.getBounds(); >+ IDialogSettings settings = plugin.getDialogSettings(); >+ IDialogSettings pageDialogSettings = settings.getSection(pageName); >+ if (pageDialogSettings == null) { >+ pageDialogSettings = settings.addNewSection(pageName); >+ >+ } >+ IDialogSettings dialogBounds = settings.getSection(DIALOG_BOUNDS_KEY); >+ if (dialogBounds == null) { >+ dialogBounds = new DialogSettings(DIALOG_BOUNDS_KEY); >+ settings.addSection(dialogBounds); >+ } >+ if (bounds != null && dialogBounds != null) { >+ try { >+ bounds.x = dialogBounds.getInt(X); >+ bounds.y = dialogBounds.getInt(Y); >+ bounds.height = dialogBounds.getInt(HEIGHT); >+ bounds.width = dialogBounds.getInt(WIDTH); >+ shell.setBounds(bounds); >+ } catch (NumberFormatException e) { >+ // silently ignored >+ } >+ } >+ } >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java,v >retrieving revision 1.5 >diff -u -r1.5 AbstractRepositoryQueryPage2.java >--- src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java 16 Jan 2009 04:36:04 -0000 1.5 >+++ src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java 26 Jan 2009 23:28:10 -0000 >@@ -16,6 +16,8 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.OperationCanceledException; > import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.DialogSettings; >+import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.operation.IRunnableWithProgress; >@@ -29,6 +31,7 @@ > import org.eclipse.swt.events.KeyListener; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.layout.FillLayout; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -37,8 +40,10 @@ > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.plugin.AbstractUIPlugin; > import org.eclipse.ui.progress.IProgressService; > > /** >@@ -57,6 +62,17 @@ > > private boolean needsRepositoryConfiguration = true; > >+ // dialog store id constants >+ private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ >+ >+ private static final String X = "x"; //$NON-NLS-1$ >+ >+ private static final String Y = "y"; //$NON-NLS-1$ >+ >+ private static final String WIDTH = "width"; //$NON-NLS-1$ >+ >+ private static final String HEIGHT = "height"; //$NON-NLS-1$ >+ > public AbstractRepositoryQueryPage2(String pageName, TaskRepository repository, IRepositoryQuery query) { > super(pageName, repository, query); > this.connector = TasksUi.getRepositoryConnector(getTaskRepository().getConnectorKind()); >@@ -266,4 +282,38 @@ > } > } > >+ @Override >+ public Shell getShell() { >+ Shell shell = null; >+ if (getWizard() != null && getWizard().getContainer() != null) { >+ shell = getWizard().getContainer().getShell(); >+ } >+ if (shell == null && getControl() != null) { >+ shell = getControl().getShell(); >+ } >+ return shell; >+ } >+ >+ protected void saveBounds(AbstractUIPlugin plugin, String pageName) { >+ Shell shell = getShell(); >+ if (shell != null) { >+ Rectangle bounds = shell.getBounds(); >+ IDialogSettings settings = plugin.getDialogSettings(); >+ IDialogSettings pageDialogSettings = settings.getSection(pageName); >+ if (pageDialogSettings == null) { >+ pageDialogSettings = settings.addNewSection(pageName); >+ >+ } >+ IDialogSettings dialogBounds = settings.getSection(DIALOG_BOUNDS_KEY); >+ if (dialogBounds == null) { >+ dialogBounds = new DialogSettings(DIALOG_BOUNDS_KEY); >+ settings.addSection(dialogBounds); >+ } >+ dialogBounds.put(X, bounds.x); >+ dialogBounds.put(Y, bounds.y); >+ dialogBounds.put(WIDTH, bounds.width); >+ dialogBounds.put(HEIGHT, bounds.height); >+ } >+ } >+ > } >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java,v >retrieving revision 1.119 >diff -u -r1.119 BugzillaSearchPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java 3 Jan 2009 14:33:27 -0000 1.119 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java 26 Jan 2009 23:28:11 -0000 >@@ -1788,25 +1788,7 @@ > } > > private void restoreBounds() { >- IDialogSettings settings = getDialogSettings(); >- IDialogSettings dialogBounds = settings.getSection(DIALOG_BOUNDS_KEY); >- Shell shell = getShell(); >- if (shell != null) { >- Rectangle bounds = shell.getBounds(); >- >- if (bounds != null && dialogBounds != null) { >- try { >- bounds.x = dialogBounds.getInt(X); >- bounds.y = dialogBounds.getInt(Y); >- bounds.height = dialogBounds.getInt(HEIGHT); >- bounds.width = dialogBounds.getInt(WIDTH); >- shell.setBounds(bounds); >- } catch (NumberFormatException e) { >- // silently ignored >- } >- } >- } >- >+ restoreBounds(BugzillaUiPlugin.getDefault(), PAGE_NAME); > } > > /* Testing hook to see if any products are present */ >@@ -1943,10 +1925,7 @@ > public void applyTo(IRepositoryQuery query) { > query.setUrl(getQueryURL(getTaskRepository(), getQueryParameters())); > query.setSummary(getQueryTitle()); >- Shell shell = getShell(); >- if (shell != null) { >- saveBounds(shell.getBounds()); >- } >+ saveBounds(BugzillaUiPlugin.getDefault(), PAGE_NAME); > } > > }
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 261683
: 123840 |
123841