diff options
author | Tomasz Zarna | 2007-11-26 12:29:52 +0000 |
---|---|---|
committer | Tomasz Zarna | 2007-11-26 12:29:52 +0000 |
commit | f8a668a3c4303a36cb7af8a4c9d807aa0d1e6bfd (patch) | |
tree | be6ca0a0edd5a9322bbb0c764173207acfd536a7 | |
parent | 136f0a68b4e629803cc5b5f331e82b720798d0ad (diff) | |
download | eclipse.platform.team-f8a668a3c4303a36cb7af8a4c9d807aa0d1e6bfd.tar.gz eclipse.platform.team-f8a668a3c4303a36cb7af8a4c9d807aa0d1e6bfd.tar.xz eclipse.platform.team-f8a668a3c4303a36cb7af8a4c9d807aa0d1e6bfd.zip |
bug 210789: Patch creation dialog has a confusing layout of controls
2 files changed, 58 insertions, 85 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index d60b19a05..25a42c993 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -366,7 +366,7 @@ AddToBranchAction_enterTagLong=Enter the name of the branch: GenerateCVSDiff_title=Create Patch GenerateCVSDiff_pageTitle=Create a Patch Using the CVS Diff Command -GenerateCVSDiff_pageDescription=The results of the CVS diff command can be used as an input file for the Apply Patch wizard. +GenerateCVSDiff_pageDescription=Specify the input and the location for the patch. GenerateCVSDiff_overwriteTitle=Confirm Overwrite GenerateCVSDiff_overwriteMsg=A file with that name already exists. Overwrite? GenerateCVSDiff_error=Error running the CVS diff command @@ -623,12 +623,12 @@ Unmanage_unmanagingError=Errors occurred while disconnecting Unmanage_message=Are you sure you want to disconnect CVS from ''{0}''? Unmanage_messageN=Are you sure you want to disconnect CVS from these {0} projects? -Save_To_Clipboard_2=&Save to clipboard -Save_In_File_System_3=Sa&ve in file system +Save_To_Clipboard_2=&Clipboard +Save_In_File_System_3=Fil&e Browse____4=Br&owse... Save_Patch_As_5=Save Patch As patch_txt_6=patch.txt -Save_In_Workspace_7=Save in &workspace +Save_In_Workspace_7=&Workspace WorkspacePatchDialogTitle=Set a Patch Location WorkspacePatchDialogDescription=Select a folder in the workspace and enter a name for the patch. Fi_le_name__9=Fi&le name: @@ -986,7 +986,7 @@ GenerateDiffFileWizard_5=Please enter a valid filename. GenerateDiffFileWizard_6=&Workspace (Multi-project Apply Patch wizard specific) GenerateDiffFileWizard_7=&Project GenerateDiffFileWizard_8=S&election -GenerateDiffFileWizard_9=Save Patch in Workspace +GenerateDiffFileWizard_9=Save Patch GenerateDiffFileWizard_10=Patch Root GenerateDiffFileWizard_11=Include Binary Files? GenerateDiffFileWizard_12=The selected resources include files marked as binary. CVS does not handle the creation of patches for binary files. Should the files marked as binary be included? diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java index 91e40fa02..3dc8a51f2 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java @@ -494,16 +494,7 @@ public class GenerateDiffFileWizard extends Wizard { PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PATCH_SELECTION_PAGE); //Create a location group - Group locationGroup = new Group(composite, SWT.None); - GridLayout layout = new GridLayout(); - locationGroup.setLayout(layout); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - locationGroup.setLayoutData(data); - locationGroup.setText(CVSUIMessages.GenerateDiffFileWizard_9); - // - setupClipboardControls(locationGroup); - setupFilesystemControls(locationGroup); - setupWorkspaceControls(locationGroup); + setupLocationControls(composite); initializeDefaultValues(); @@ -563,80 +554,62 @@ public class GenerateDiffFileWizard extends Wizard { return button; } - /** - * Setup the controls for the workspace option. - */ - private void setupWorkspaceControls(Composite composite) { - GridLayout layout; - - wsRadio= new Button(composite, SWT.RADIO); - wsRadio.setText(CVSUIMessages.Save_In_Workspace_7); - - final Composite nameGroup = new Composite(composite,SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 0; - nameGroup.setLayout(layout); - final GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); - nameGroup.setLayoutData(data); - - wsPathText= new Text(nameGroup, SWT.BORDER); - GridData gd= new GridData(GridData.FILL_HORIZONTAL); - gd.verticalAlignment = GridData.CENTER; - gd.grabExcessVerticalSpace = false; - gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - wsPathText.setLayoutData(gd); - wsPathText.setEditable(false); - - wsBrowseButton = new Button(nameGroup, SWT.NULL); - gd = new GridData(); - gd.horizontalAlignment = GridData.FILL; - int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - gd.widthHint = Math.max(widthHint, wsBrowseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - wsBrowseButton.setLayoutData(gd); - wsBrowseButton.setText(CVSUIMessages.Browse____4); - } /** - * Setup the controls for the file system option. + * Setup the controls for the location. */ - private void setupFilesystemControls(final Composite composite) { - GridLayout layout; - fsRadio= new Button(composite, SWT.RADIO); + private void setupLocationControls(final Composite parent) { + final Composite composite = new Composite(parent, SWT.NULL); + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 3; + composite.setLayout(gridLayout); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - fsRadio.setText(CVSUIMessages.Save_In_File_System_3); - - final Composite nameGroup = new Composite(composite,SWT.NONE); - layout = new GridLayout(); - layout.numColumns = 2; - layout.marginWidth = 0; - nameGroup.setLayout(layout); - final GridData data = new GridData(SWT.FILL, SWT.FILL, true, false); - nameGroup.setLayoutData(data); - - fsPathText= new Text(nameGroup, SWT.BORDER); - GridData gd= new GridData(GridData.FILL_HORIZONTAL); - gd.verticalAlignment = GridData.CENTER; - gd.grabExcessVerticalSpace = false; - gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - fsPathText.setLayoutData(gd); - - fsBrowseButton = new Button(nameGroup, SWT.NULL); - gd = new GridData(); - gd.horizontalAlignment = GridData.FILL; - int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - gd.widthHint = Math.max(widthHint, fsBrowseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - fsBrowseButton.setLayoutData(gd); - fsBrowseButton.setText(CVSUIMessages.Browse____4); - } - - /** - * Setup the controls for the clipboard option. - */ - private void setupClipboardControls(final Composite composite) { - cpRadio= new Button(composite, SWT.RADIO); - cpRadio.setText(CVSUIMessages.Save_To_Clipboard_2); - } + // clipboard + GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); + gd.horizontalSpan = 3; + cpRadio = new Button(composite, SWT.RADIO); + cpRadio.setText(CVSUIMessages.Save_To_Clipboard_2); + cpRadio.setLayoutData(gd); + + // filesystem + fsRadio = new Button(composite, SWT.RADIO); + fsRadio.setText(CVSUIMessages.Save_In_File_System_3); + + fsPathText = new Text(composite, SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + fsPathText.setLayoutData(gd); + + fsBrowseButton = new Button(composite, SWT.PUSH); + fsBrowseButton.setText(CVSUIMessages.Browse____4); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); + Point minSize = fsBrowseButton.computeSize(SWT.DEFAULT, + SWT.DEFAULT, true); + data.widthHint = Math.max(widthHint, minSize.x); + fsBrowseButton.setLayoutData(data); + + // workspace + wsRadio = new Button(composite, SWT.RADIO); + wsRadio.setText(CVSUIMessages.Save_In_Workspace_7); + + wsPathText = new Text(composite, SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + wsPathText.setLayoutData(gd); + wsPathText.setEditable(false); + + wsBrowseButton = new Button(composite, SWT.PUSH); + wsBrowseButton.setText(CVSUIMessages.Browse____4); + data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); + minSize = fsBrowseButton + .computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + data.widthHint = Math.max(widthHint, minSize.x); + wsBrowseButton.setLayoutData(data); + + // change the cpRadio layout to be of the same height as other rows' layout + ((GridData)cpRadio.getLayoutData()).heightHint = minSize.y; + } private ParticipantPagePane fPagePane; private PageBook bottomChild; |