Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2005-08-05 16:27:07 -0400
committerMichael Valenta2005-08-05 16:27:07 -0400
commite7729d4096d4c6fef751f6d6a677a8a43308b8af (patch)
tree47d1ecd11249e1bf91ef39b93cf0494bc0896c53
parent0294367743c78f519ff75b42dda5b19c1492ff9f (diff)
downloadeclipse.platform.team-e7729d4096d4c6fef751f6d6a677a8a43308b8af.tar.gz
eclipse.platform.team-e7729d4096d4c6fef751f6d6a677a8a43308b8af.tar.xz
eclipse.platform.team-e7729d4096d4c6fef751f6d6a677a8a43308b8af.zip
Bug 106084 TVT 3.1: TCT567 - Team>CVS>Password management >Remove All button truncatedM20050805
-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