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 87361 Details for
Bug 209565
[Dialogs] The OK button in ContainerSelectionDialog should be disabled if no project is available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to disable the 'OK' button if there are no containers to select.
bug209565-patch.txt (text/plain), 4.11 KB, created by
Remy Suen
on 2008-01-20 14:51:38 EST
(
hide
)
Description:
Patch to disable the 'OK' button if there are no containers to select.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2008-01-20 14:51:38 EST
Size:
4.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: src/org/eclipse/ui/internal/ide/misc/ContainerSelectionGroup.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/misc/ContainerSelectionGroup.java,v >retrieving revision 1.18 >diff -u -r1.18 ContainerSelectionGroup.java >--- src/org/eclipse/ui/internal/ide/misc/ContainerSelectionGroup.java 11 Apr 2007 15:09:35 -0000 1.18 >+++ src/org/eclipse/ui/internal/ide/misc/ContainerSelectionGroup.java 20 Jan 2008 19:50:39 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,8 @@ > * IBM Corporation - initial API and implementation > * Igor Fedorenko <igorfie@yahoo.com> - > * Fix for Bug 136921 [IDE] New File dialog locks for 20 seconds >+ * Remy Chi Jian Suen <remy.suen@gmail.com> - >+ * Fix for Bug 209565 [Dialogs] The OK button in ContainerSelectionDialog should be disabled if no project is available > *******************************************************************************/ > package org.eclipse.ui.internal.ide.misc; > >@@ -293,6 +295,14 @@ > // This has to be done after the viewer has been laid out > treeViewer.setInput(ResourcesPlugin.getWorkspace()); > } >+ >+ /** >+ * Returns whether there are any containers available for the user to select. >+ * @return <tt>true</tt> if there are selectable containers, <tt>false</tt> otherwise >+ */ >+ public boolean hasContainers() { >+ return treeViewer.getTree().getItems() != 0; >+ } > > /** > * Returns the currently entered container name. Null if the field is empty. >Index: extensions/org/eclipse/ui/dialogs/ContainerSelectionDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ContainerSelectionDialog.java,v >retrieving revision 1.10 >diff -u -r1.10 ContainerSelectionDialog.java >--- extensions/org/eclipse/ui/dialogs/ContainerSelectionDialog.java 2 Jul 2007 22:56:07 -0000 1.10 >+++ extensions/org/eclipse/ui/dialogs/ContainerSelectionDialog.java 20 Jan 2008 19:50:39 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,9 @@ > * IBM Corporation - initial API and implementation > * Sebastian Davids <sdavids@gmx.de> - Fix for bug 19346 - Dialog > * font should be activated and used by other components. >+ * Remy Chi Jian Suen <remy.suen@gmail.com> - Fix for bug 209565 - [Dialogs] >+ * The OK button in ContainerSelectionDialog should be disabled if no >+ * project is available > *******************************************************************************/ > > package org.eclipse.ui.dialogs; >@@ -18,6 +21,7 @@ > > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.widgets.Composite; >@@ -106,6 +110,16 @@ > } > > /* (non-Javadoc) >+ * Method declared in Window. >+ */ >+ protected Control createContents(Composite parent) { >+ Control control = super.createContents(parent); >+ // disable the 'OK' button if there are no containers to select >+ getButton(IDialogConstants.OK_ID).setEnabled(group.hasContainers()); >+ return control; >+ } >+ >+ /* (non-Javadoc) > * Method declared on Dialog. > */ > protected Control createDialogArea(Composite parent) {
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 209565
:
87361
|
89060