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 68736 Details for
Bug 188910
[clean up] Clean Up wizard needs too much space/is ugly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
fix
fix_188910.txt (text/plain), 15.57 KB, created by
Benno Baumgartner
on 2007-05-25 04:31:24 EDT
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2007-05-25 04:31:24 EDT
Size:
15.57 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantConfigurationModifyDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantConfigurationModifyDialog.java,v >retrieving revision 1.2 >diff -u -r1.2 CleanUpSaveParticipantConfigurationModifyDialog.java >--- ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantConfigurationModifyDialog.java 13 Apr 2007 13:20:16 -0000 1.2 >+++ ui/org/eclipse/jdt/internal/ui/fix/CleanUpSaveParticipantConfigurationModifyDialog.java 25 May 2007 08:30:24 -0000 >@@ -109,18 +109,7 @@ > fTabFolder.setFont(composite.getFont()); > fTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > >- fPages= new CleanUpTabPage[5]; >- fPages[0]= new CodeStyleTabPage(this, fWorkingValues, true); >- fPages[1]= new MemberAccessesTabPage(this, fWorkingValues, true); >- fPages[2]= new UnnecessaryCodeTabPage(this, fWorkingValues, true); >- fPages[3]= new MissingCodeTabPage(this, fWorkingValues, true); >- fPages[4]= new CodeFormatingTabPage(this, fWorkingValues, true); >- >- addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_CodeStyle_TabPage, fPages[0]); >- addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_MemberAccesses_TabPage, fPages[1]); >- addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_UnnecessaryCode_TabPage, fPages[2]); >- addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_MissingCode_TabPage, fPages[3]); >- addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_CodeOrganizing_TabPage, fPages[4]); >+ fPages= createTabPages(fWorkingValues); > > fCountLabel= new Label(composite, SWT.NONE); > fCountLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); >@@ -143,6 +132,23 @@ > > return composite; > } >+ >+ protected CleanUpTabPage[] createTabPages(Map workingValues) { >+ CleanUpTabPage[] result= new CleanUpTabPage[5]; >+ result[0]= new CodeStyleTabPage(this, workingValues, true); >+ result[1]= new MemberAccessesTabPage(this, workingValues, true); >+ result[2]= new UnnecessaryCodeTabPage(this, workingValues, true); >+ result[3]= new MissingCodeTabPage(this, workingValues, true); >+ result[4]= new CodeFormatingTabPage(this, workingValues, true); >+ >+ addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_CodeStyle_TabPage, result[0]); >+ addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_MemberAccesses_TabPage, result[1]); >+ addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_UnnecessaryCode_TabPage, result[2]); >+ addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_MissingCode_TabPage, result[3]); >+ addTabPage(SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_CodeOrganizing_TabPage, result[4]); >+ >+ return result; >+ } > > public void updateStatus(IStatus status) { > int count= 0; >Index: ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.java,v >retrieving revision 1.45 >diff -u -r1.45 MultiFixMessages.java >--- ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.java 27 Feb 2007 17:16:09 -0000 1.45 >+++ ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.java 25 May 2007 08:30:24 -0000 >@@ -25,6 +25,8 @@ > public static String CleanUpRefactoringWizard_code_organizing_tab; > public static String CleanUpRefactoringWizard_code_style_tab; > public static String CleanUpRefactoringWizard_Configure_Button; >+ public static String CleanUpRefactoringWizard_ConfigureCustomProfile_button; >+ public static String CleanUpRefactoringWizard_CustomCleanUpsDialog_title; > public static String CleanUpRefactoringWizard_HideWizard_Link; > public static String CleanUpRefactoringWizard_member_accesses_tab; > public static String CleanUpRefactoringWizard_missing_code_tab; >Index: ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.properties,v >retrieving revision 1.65 >diff -u -r1.65 MultiFixMessages.properties >--- ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.properties 4 Apr 2007 15:11:22 -0000 1.65 >+++ ui/org/eclipse/jdt/internal/ui/fix/MultiFixMessages.properties 25 May 2007 08:30:24 -0000 >@@ -67,6 +67,8 @@ > > CleanUpRefactoringWizard_CleanUpConfigurationPage_title=Clean Up Configuration > CleanUpRefactoringWizard_UnmanagedProfileWithName_Name=Unmanaged profile ''{0}'' >+CleanUpRefactoringWizard_ConfigureCustomProfile_button=Confi&gure... >+CleanUpRefactoringWizard_CustomCleanUpsDialog_title=Custom Clean Ups > > CommentFormatFix_description=Format comment > >Index: ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java,v >retrieving revision 1.62 >diff -u -r1.62 CleanUpRefactoringWizard.java >--- ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java 22 May 2007 17:01:22 -0000 1.62 >+++ ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java 25 May 2007 08:30:24 -0000 >@@ -35,11 +35,12 @@ > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Link; > import org.eclipse.swt.widgets.Shell; >-import org.eclipse.swt.widgets.TabFolder; >-import org.eclipse.swt.widgets.TabItem; >+import org.eclipse.swt.widgets.Table; > > import org.eclipse.jface.dialogs.ControlEnableState; > import org.eclipse.jface.viewers.ColumnLayoutData; >@@ -67,19 +68,21 @@ > > import org.eclipse.jdt.internal.ui.JavaPlugin; > import org.eclipse.jdt.internal.ui.JavaPluginImages; >+import org.eclipse.jdt.internal.ui.preferences.BulletListBlock; > import org.eclipse.jdt.internal.ui.preferences.CleanUpPreferencePage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.CleanUpProfileVersioner; >+import org.eclipse.jdt.internal.ui.preferences.cleanup.CleanUpTabPage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.CodeFormatingTabPage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.CodeStyleTabPage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.MemberAccessesTabPage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.MissingCodeTabPage; > import org.eclipse.jdt.internal.ui.preferences.cleanup.UnnecessaryCodeTabPage; >-import org.eclipse.jdt.internal.ui.preferences.formatter.ModifyDialogTabPage; > import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager; > import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileStore; > import org.eclipse.jdt.internal.ui.preferences.formatter.ModifyDialogTabPage.IModificationListener; > import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile; > import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.Profile; >+import org.eclipse.jdt.internal.ui.util.SWTUtil; > import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; > import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; > import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter; >@@ -92,7 +95,6 @@ > > private static final String USE_CUSTOM_PROFILE_KEY= "org.eclipse.jdt.ui.cleanup.use_dialog_profile"; //$NON-NLS-1$ > private static final String CUSTOM_PROFILE_KEY= "org.eclipse.jdt.ui.cleanup.custom_profile"; //$NON-NLS-1$ >- private static final String LAST_SELECTED_TAB_PAGE_INDEX= "org.eclipse.jdt.ui.cleanup.selected_tab_page"; //$NON-NLS-1$ > > private static class ProjectProfileLableProvider extends LabelProvider implements ITableLabelProvider { > >@@ -211,7 +213,7 @@ > private final CleanUpRefactoring fCleanUpRefactoring; > private Map fCustomSettings; > private SelectionButtonDialogField fUseCustomField; >- >+ > private ControlEnableState fEnableState; > > public CleanUpConfigurationPage(CleanUpRefactoring refactoring) { >@@ -263,10 +265,19 @@ > settingsField.setViewerComparator(new ViewerComparator()); > > settingsField.doFillIntoGrid(composite, 3); >+ >+ Table table= settingsField.getTableViewer().getTable(); > GridData data= (GridData)settingsField.getListControl(null).getLayoutData(); > data.horizontalIndent= 15; >+ data.grabExcessVerticalSpace= false; >+ data.heightHint= SWTUtil.getTableHeightHint(table, fCleanUpRefactoring.getProjects().length + 1); > data.grabExcessHorizontalSpace= true; >+ data.verticalAlignment= GridData.BEGINNING; > >+ data= (GridData)settingsField.getButtonBox(null).getLayoutData(); >+ data.grabExcessVerticalSpace= false; >+ data.verticalAlignment= GridData.BEGINNING; >+ > data= (GridData)settingsField.getLabelControl(null).getLayoutData(); > data.exclude= true; > >@@ -290,30 +301,53 @@ > } > } > >- final TabFolder tabFolder= createTabFolder(composite, fCustomSettings); >- tabFolder.addSelectionListener(new SelectionAdapter() { >+ final BulletListBlock bulletListBlock= new BulletListBlock(); >+ Control bulletList= bulletListBlock.createControl(composite); >+ GridData layoutData= (GridData)bulletList.getLayoutData(); >+ (layoutData).horizontalIndent= 15; >+ layoutData.grabExcessVerticalSpace= true; >+ >+ final Button configure= new Button(composite, SWT.NONE); >+ configure.setText(MultiFixMessages.CleanUpRefactoringWizard_ConfigureCustomProfile_button); >+ >+ data= new GridData(SWT.TOP, SWT.LEAD, false, false); >+ data.widthHint= SWTUtil.getButtonWidthHint(configure); >+ configure.setLayoutData(data); >+ >+ showCustomSettings(bulletListBlock); >+ configure.addSelectionListener(new SelectionAdapter() { >+ /** >+ * {@inheritDoc} >+ */ > public void widgetSelected(SelectionEvent e) { >- getDialogSettings().put(LAST_SELECTED_TAB_PAGE_INDEX, tabFolder.getSelectionIndex()); >+ CleanUpSaveParticipantConfigurationModifyDialog dialog= new CleanUpSaveParticipantConfigurationModifyDialog(getShell(), fCustomSettings, MultiFixMessages.CleanUpRefactoringWizard_CustomCleanUpsDialog_title) { >+ protected CleanUpTabPage[] createTabPages(Map workingValues) { >+ CleanUpTabPage[] result= new CleanUpTabPage[5]; >+ result[0]= new CodeStyleTabPage(this, workingValues, false); >+ result[1]= new MemberAccessesTabPage(this, workingValues, false); >+ result[2]= new UnnecessaryCodeTabPage(this, workingValues, false); >+ result[3]= new MissingCodeTabPage(this, workingValues, false); >+ result[4]= new CodeFormatingTabPage(this, workingValues, false); >+ >+ addTabPage(MultiFixMessages.CleanUpRefactoringWizard_code_style_tab, result[0]); >+ addTabPage(MultiFixMessages.CleanUpRefactoringWizard_member_accesses_tab, result[1]); >+ addTabPage(MultiFixMessages.CleanUpRefactoringWizard_unnecessary_code_tab, result[2]); >+ addTabPage(MultiFixMessages.CleanUpRefactoringWizard_missing_code_tab, result[3]); >+ addTabPage(MultiFixMessages.CleanUpRefactoringWizard_code_organizing_tab, result[4]); >+ >+ return result; >+ } >+ }; >+ dialog.open(); >+ showCustomSettings(bulletListBlock); > } > }); > >- settingsField.getListControl(null).setEnabled(!isCustom); >- if (isCustom) { >- fEnableState= ControlEnableState.disable(settingsField.getButtonBox(null)); >- } else { >- fEnableState= ControlEnableState.disable(tabFolder); >- } >+ updateEnableState(isCustom, settingsField, configure, bulletListBlock); > > fUseCustomField.setDialogFieldListener(new IDialogFieldListener() { > public void dialogFieldChanged(DialogField field) { >- fEnableState.restore(); >- boolean isCustomSelected= fUseCustomField.isSelected(); >- settingsField.getListControl(null).setEnabled(!isCustomSelected); >- if (isCustomSelected) { >- fEnableState= ControlEnableState.disable(settingsField.getButtonBox(null)); >- } else { >- fEnableState= ControlEnableState.disable(tabFolder); >- } >+ updateEnableState(fUseCustomField.isSelected(), settingsField, configure, bulletListBlock); > } > }); > >@@ -336,35 +370,35 @@ > setControl(composite); > } > >- private TabFolder createTabFolder(Composite composite, Map settings) { >- final TabFolder tabFolder = new TabFolder(composite, SWT.NONE); >- tabFolder.setFont(composite.getFont()); >- GridData gridData= new GridData(SWT.FILL, SWT.TOP, true, false); >- gridData.horizontalIndent= 15; >- gridData.horizontalSpan= 2; >- tabFolder.setLayoutData(gridData); >- >- addTabPage(tabFolder, MultiFixMessages.CleanUpRefactoringWizard_code_style_tab, new CodeStyleTabPage(this, settings, false)); >- addTabPage(tabFolder, MultiFixMessages.CleanUpRefactoringWizard_member_accesses_tab, new MemberAccessesTabPage(this, settings, false)); >- addTabPage(tabFolder, MultiFixMessages.CleanUpRefactoringWizard_unnecessary_code_tab, new UnnecessaryCodeTabPage(this, settings, false)); >- addTabPage(tabFolder, MultiFixMessages.CleanUpRefactoringWizard_missing_code_tab, new MissingCodeTabPage(this, settings, false)); >- addTabPage(tabFolder, MultiFixMessages.CleanUpRefactoringWizard_code_organizing_tab, new CodeFormatingTabPage(this, settings, false)); >- >- try { >- int lastTabIndex= getDialogSettings().getInt(LAST_SELECTED_TAB_PAGE_INDEX); >- tabFolder.setSelection(lastTabIndex); >- } catch (NumberFormatException e1) { >- } >- >- return tabFolder; >+ private void updateEnableState(boolean isCustom, final ListDialogField settingsField, Button configureCustom, BulletListBlock bulletListBlock) { >+ settingsField.getListControl(null).setEnabled(!isCustom); >+ if (isCustom) { >+ fEnableState= ControlEnableState.disable(settingsField.getButtonBox(null)); >+ } else if (fEnableState != null) { >+ fEnableState.restore(); >+ fEnableState= null; >+ } >+ bulletListBlock.setEnabled(isCustom); >+ configureCustom.setEnabled(isCustom); >+ } >+ >+ private void showCustomSettings(BulletListBlock bulletListBlock) { >+ StringBuffer buf= new StringBuffer(); >+ >+ final ICleanUp[] cleanUps= CleanUpRefactoring.createCleanUps(fCustomSettings); >+ for (int i= 0; i < cleanUps.length; i++) { >+ String[] descriptions= cleanUps[i].getDescriptions(); >+ if (descriptions != null) { >+ for (int j= 0; j < descriptions.length; j++) { >+ if (buf.length() > 0) { >+ buf.append('\n'); >+ } >+ buf.append(descriptions[j]); >+ } >+ } >+ } >+ bulletListBlock.setText(buf.toString()); > } >- >- protected final void addTabPage(TabFolder tabFolder, String title, ModifyDialogTabPage tabPage) { >- final TabItem tabItem= new TabItem(tabFolder, SWT.NONE); >- tabItem.setText(title); >- tabItem.setData(tabPage); >- tabItem.setControl(tabPage.createContents(tabFolder)); >- } > > protected boolean performFinish() { > initializeRefactoring();
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 188910
:
68571
|
68736
|
68771