Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/PasswordManagementPreferencePage.java31
1 files changed, 13 insertions, 18 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/PasswordManagementPreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/PasswordManagementPreferencePage.java
index 8f796507a..cee1e8b16 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/PasswordManagementPreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/PasswordManagementPreferencePage.java
@@ -14,7 +14,6 @@ import java.util.*;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
@@ -26,6 +25,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;
import org.eclipse.team.internal.ui.PixelConverter;
+import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.ui.*;
public class PasswordManagementPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
@@ -51,7 +51,7 @@ public class PasswordManagementPreferencePage extends PreferencePage implements
};
public void init(IWorkbench workbench) {
- setDescription(CVSUIMessages.PasswordManagementPreferencePage_2); //$NON-NLS-1$
+ setDescription(CVSUIMessages.PasswordManagementPreferencePage_2);
}
/**
@@ -88,8 +88,8 @@ public class PasswordManagementPreferencePage extends PreferencePage implements
new TableColumn(table, SWT.NULL);
new TableColumn(table, SWT.NULL);
TableColumn[] columns = table.getColumns();
- columns[0].setText(CVSUIMessages.PasswordManagementPreferencePage_3); //$NON-NLS-1$
- columns[1].setText(CVSUIMessages.PasswordManagementPreferencePage_4); //$NON-NLS-1$
+ columns[0].setText(CVSUIMessages.PasswordManagementPreferencePage_3);
+ columns[1].setText(CVSUIMessages.PasswordManagementPreferencePage_4);
viewer.setColumnProperties(new String[] {"location", "username"}); //$NON-NLS-1$ //$NON-NLS-2$
viewer.setLabelProvider(new TableLabelProvider());
viewer.setContentProvider(new IStructuredContentProvider() {
@@ -124,13 +124,7 @@ public class PasswordManagementPreferencePage extends PreferencePage implements
buttons.setLayout(layout);
removeButton = new Button(buttons, SWT.PUSH);
- removeButton.setText(CVSUIMessages.PasswordManagementPreferencePage_5); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- removeButton.setLayoutData(data);
+ removeButton.setText(CVSUIMessages.PasswordManagementPreferencePage_5);
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
@@ -138,19 +132,20 @@ public class PasswordManagementPreferencePage extends PreferencePage implements
}
});
removeAllButton = new Button(buttons, SWT.PUSH);
- removeAllButton.setText(CVSUIMessages.PasswordManagementPreferencePage_6); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- removeAllButton.setLayoutData(data);
+ removeAllButton.setText(CVSUIMessages.PasswordManagementPreferencePage_6);
removeAllButton.setEnabled(true);
removeAllButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removeAll();
}
});
+
+ // Use the same size for the buttons and ensure they conform to the proper minimum size
+ int buttonWidth = SWTUtils.calculateControlSize(SWTUtils.createDialogPixelConverter(parent), new Button [] { removeButton, removeAllButton });
+ data = SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.END, SWT.CENTER, false, false);
+ removeButton.setLayoutData(data);
+ removeAllButton.setLayoutData(data);
+
Dialog.applyDialogFont(ancestor);
viewer.setInput(KnownRepositories.getInstance());
handleSelection();

Back to the top