Skip to content

Commit 408812a

Browse files
committed
Remove unnecessary Apply and close button in property dialog
This commit retains only the cancel button and eliminates the Apply and close button in the property dialog which is unnecessary in the current context there. There is only a description provided in the property dialog and there is no event that needs an apply option.
1 parent a086677 commit 408812a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/PropertyDialog.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717

1818
import java.util.Iterator;
1919
import org.eclipse.core.runtime.Adapters;
20+
import org.eclipse.jface.dialogs.IDialogConstants;
2021
import org.eclipse.jface.dialogs.MessageDialog;
2122
import org.eclipse.jface.preference.IPreferenceNode;
2223
import org.eclipse.jface.preference.PreferenceManager;
2324
import org.eclipse.jface.viewers.ISelection;
2425
import org.eclipse.jface.viewers.IStructuredSelection;
2526
import org.eclipse.jface.viewers.StructuredSelection;
2627
import org.eclipse.osgi.util.NLS;
28+
import org.eclipse.swt.widgets.Composite;
2729
import org.eclipse.swt.widgets.Control;
2830
import org.eclipse.swt.widgets.Shell;
2931
import org.eclipse.ui.PlatformUI;
@@ -91,6 +93,11 @@ public static PropertyDialog createDialogOn(Shell shell, final String propertyPa
9193

9294
}
9395

96+
@Override
97+
protected void createButtonsForButtonBar(Composite parent) {
98+
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
99+
}
100+
94101
@Override
95102
protected void addButtonsToHelpControl(Control control) {
96103
// Overridden to remove import/export buttons
@@ -162,6 +169,11 @@ protected String getSelectedNodePreference() {
162169
return lastPropertyId;
163170
}
164171

172+
@Override
173+
public void updateButtons() {
174+
// This function is overridden to remove the Apply and close button
175+
}
176+
165177
/**
166178
* Get the name of the selected item preference
167179
*/

0 commit comments

Comments
 (0)