| author | Ning Zhang | 2011-08-29 03:02:44 (EDT) |
|---|---|---|
| committer | xgu | 2011-08-31 02:01:03 (EDT) |
| commit | ea7706875d667e4efb71cf8569aea3ef8decfd80 (patch) (side-by-side diff) | |
| tree | 5d0cad7ba59267d1911f7a1bc229bb4b38cb5eee | |
| parent | a2b45b08d6bbdf7d984e9958c52c5e4ca9fc3199 (diff) | |
| download | org.eclipse.birt-ea7706875d667e4efb71cf8569aea3ef8decfd80.zip org.eclipse.birt-ea7706875d667e4efb71cf8569aea3ef8decfd80.tar.gz org.eclipse.birt-ea7706875d667e4efb71cf8569aea3ef8decfd80.tar.bz2 | |
- Summary: Added a checkbox to the "Move local bindings to the parent" dialog to remember the decision made. - Bugzilla Bug(s) Resolved: None - Description: Added a checkbox to the "Move local bindings to the parent" dialog to remember the decision made. - Tests Description: Manual Test - Code Reviewer: None - Files Added: None - Files Edited: NA - Files Deleted: None - Notes to Build Team: None - Notes to Developers: None - Notes to QA: None - Notes to Documentation: None
5 files changed, 82 insertions, 10 deletions
diff --git a/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/nls/messages.properties b/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/nls/messages.properties index aeefafe..75fb53b 100644 --- a/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/nls/messages.properties +++ b/UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/nls/messages.properties @@ -1495,7 +1495,8 @@ ExportToCPSouceAction.action.text=Externalize to C&onnection Profile... ########################################################### #LibraryExplorerTreeViewPage tooltips LibraryElementsToolHandleExtends_message=The element contains local bindings without explicit data set specified, this may result in low performance at run time. Do you want to move the local bindings to the parent for better performance? -LibraryElementsToolHandleExtends_question=Prompt +LibraryElementsToolHandleExtends_question=Move the local bindings to the parent for better performance? +LibraryElementsToolHandleExtends_toggle=&Remember my decision LibraryExplorerTreeViewPage.toolTips.DragAndDropOutline=Drag and drop to Outline view LibraryExplorerTreeViewPage.toolTips.DragAndDropLayout=Drag and drop to Layout editor LibraryExplorerTreeViewPage.toolTips.DragAndDropToOutlineORLayout=Drag and drop to Outline view or Layout editor @@ -4729,7 +4730,10 @@ GeneralConfigurationBlock.button.text.enable.gradient=Enable &gradient selection GeneralConfigurationBlock.button.text.enable.animation=Enable a&nimated selection GeneralConfigurationBlock.group.label=Prompt GeneralConfigurationBlock.button.text.prompt=Show &prompt after opening library file. - +GeneralConfigurationBlock.move.binding.group=Move local bindings to parent for better performance +GeneralConfigurationBlock.move.binding.always=Al&ways +GeneralConfigurationBlock.move.binding.never=Ne&ver +GeneralConfigurationBlock.move.binding.prompt=P&rompt ########################################################### #ResetImageSizeAction diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/tools/LibraryElementsToolHandleExtends.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/tools/LibraryElementsToolHandleExtends.java index 0c792b8..5ff6862 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/tools/LibraryElementsToolHandleExtends.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/tools/LibraryElementsToolHandleExtends.java @@ -39,7 +39,8 @@ import org.eclipse.birt.report.model.api.elements.structures.ComputedColumn; import org.eclipse.birt.report.model.api.util.ColumnBindingUtil; import org.eclipse.birt.report.model.elements.interfaces.IReportItemModel; import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.jface.util.Assert; /** @@ -137,13 +138,52 @@ public class LibraryElementsToolHandleExtends extends AbstractToolHandleExtends { Object model = getModel(); boolean isMove = false; - if (needProcessDataItem( model )) + if ( needProcessDataItem( model ) ) { - if (MessageDialog.openConfirm( UIUtil.getDefaultShell( ),Messages.getString("LibraryElementsToolHandleExtends_question"), Messages.getString("LibraryElementsToolHandleExtends_message"))) //$NON-NLS-1$ //$NON-NLS-2$ + String prompt = ReportPlugin.getDefault( ) + .getPreferenceStore( ) + .getString( ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE ); + + MessageDialogWithToggle dialog; + + if ( MessageDialogWithToggle.ALWAYS.equals( prompt ) ) { - moveBindToHost( (DataItemHandle)model ); + moveBindToHost( (DataItemHandle) model ); isMove = true; } + else if ( ( prompt == null || MessageDialogWithToggle.PROMPT.equals( prompt ) ) + && ( ( dialog = MessageDialogWithToggle.openYesNoQuestion( UIUtil.getDefaultShell( ), + Messages.getString( "LibraryElementsToolHandleExtends_question" ), //$NON-NLS-1$ + Messages.getString( "LibraryElementsToolHandleExtends_message" ), //$NON-NLS-1$ + Messages.getString( "LibraryElementsToolHandleExtends_toggle" ), //$NON-NLS-1$ + false, + ReportPlugin.getDefault( ).getPreferenceStore( ), + ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE ) ) != null ) ) + { + if ( dialog.getReturnCode( ) == IDialogConstants.YES_ID ) + { + moveBindToHost( (DataItemHandle) model ); + isMove = true; + } + + if ( dialog.getToggleState( ) ) + { + if ( dialog.getReturnCode( ) == IDialogConstants.YES_ID ) + { + ReportPlugin.getDefault( ) + .getPreferenceStore( ) + .setValue( ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE, + MessageDialogWithToggle.ALWAYS ); + } + else if ( dialog.getReturnCode( ) == IDialogConstants.NO_ID ) + { + ReportPlugin.getDefault( ) + .getPreferenceStore( ) + .setValue( ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE, + MessageDialogWithToggle.NEVER ); + } + } + } } if (!isMove && model instanceof DataItemHandle) { diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/ReportPlugin.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/ReportPlugin.java index 25a994b..31afc66 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/ReportPlugin.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/ReportPlugin.java @@ -140,6 +140,7 @@ public class ReportPlugin extends AbstractUIPlugin public static final String DESCRIPTION_PREFERENCE = "designer.preview.preference.elementname.description.preferencestore"; //$NON-NLS-1$ public static final String LIBRARY_PREFERENCE = "designer.library.preference.libraries.description.preferencestore"; //$NON-NLS-1$ public static final String LIBRARY_WARNING_PREFERENCE = "designer.library.preference.libraries.warning.preferencestore"; //$NON-NLS-1$ + public static final String LIBRARY_MOVE_BINDINGS_PREFERENCE = "designer.library.preference.libraries.move.bindings.preferencestore"; //$NON-NLS-1$ public static final String TEMPLATE_PREFERENCE = "designer.preview.preference.template.description.preferencestore"; //$NON-NLS-1$ public static final String RESOURCE_PREFERENCE = "org.eclipse.birt.report.designer.ui.preferences.resourcestore"; //$NON-NLS-1$ public static final String CLASSPATH_PREFERENCE = "org.eclipse.birt.report.designer.ui.preferences.classpath"; //$NON-NLS-1$ @@ -264,6 +265,11 @@ public class ReportPlugin extends AbstractUIPlugin .setDefault( IPreferenceConstants.PALETTE_STATE, IPreferenceConstants.DEFAULT_PALETTE_STATE ); + PreferenceFactory.getInstance( ) + .getPreferences( this ) + .setDefault( LIBRARY_MOVE_BINDINGS_PREFERENCE, + MessageDialogWithToggle.PROMPT ); + initCellCursor( ); setDefaultBiDiSettings( ); diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/preferences/GeneralConfigurationBlock.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/preferences/GeneralConfigurationBlock.java index 1aa70bc..7f4e005 100644 --- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/preferences/GeneralConfigurationBlock.java +++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/preferences/GeneralConfigurationBlock.java @@ -34,7 +34,8 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock private final Key PREF_ENABLE_GRADIENT = getReportKey( ReportPlugin.ENABLE_GRADIENT_SELECTION_PREFERENCE ); private final Key PREF_ENABLE_ANIMATION = getReportKey( ReportPlugin.ENABLE_ANIMATION_SELECTION_PREFERENCE ); - private final Key PREF_LIABRARY_WARNING = getReportKey( ReportPlugin.LIBRARY_WARNING_PREFERENCE ); + private final Key PREF_LIBRARY_WARNING = getReportKey( ReportPlugin.LIBRARY_WARNING_PREFERENCE ); + private final Key PREF_LIBRARY_MOVE_BINDINGS = getReportKey( ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE ); private static final String ENABLED = "true"; //$NON-NLS-1$ private static final String DISABLED = "false"; //$NON-NLS-1$ @@ -53,7 +54,10 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock private Key[] getKeys( ) { Key[] keys = new Key[]{ - PREF_ENABLE_GRADIENT, PREF_ENABLE_ANIMATION,PREF_LIABRARY_WARNING + PREF_ENABLE_GRADIENT, + PREF_ENABLE_ANIMATION, + PREF_LIBRARY_WARNING, + PREF_LIBRARY_MOVE_BINDINGS }; return keys; } @@ -133,10 +137,28 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock group.setLayout( new GridLayout() ); addCheckBox( group, Messages.getString( "GeneralConfigurationBlock.button.text.prompt" ), //$NON-NLS-1$ - PREF_LIABRARY_WARNING, + PREF_LIBRARY_WARNING, promptValues, 0 ); + String[] labels = new String[]{ + Messages.getString( "GeneralConfigurationBlock.move.binding.group" ), //$NON-NLS-1$ + Messages.getString( "GeneralConfigurationBlock.move.binding.always" ), //$NON-NLS-1$ + Messages.getString( "GeneralConfigurationBlock.move.binding.never" ), //$NON-NLS-1$ + Messages.getString( "GeneralConfigurationBlock.move.binding.prompt" ) //$NON-NLS-1$ + }; + String[] values = new String[]{ + MessageDialogWithToggle.ALWAYS, + MessageDialogWithToggle.NEVER, + MessageDialogWithToggle.PROMPT + }; + + addRadioButton( pageContent, + labels, + PREF_LIBRARY_MOVE_BINDINGS, + values, + 0 ); + return pageContent; } diff --git a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/ui/i18n/nls.properties b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/ui/i18n/nls.properties index fd4b1ef..d722fd7 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/ui/i18n/nls.properties +++ b/xtab/org.eclipse.birt.report.item.crosstab.ui/src/org/eclipse/birt/report/item/crosstab/ui/i18n/nls.properties @@ -74,7 +74,7 @@ ShowSummaryFieldDialog.ViewStatus=Keep Current View DeleteBindingDialog.Title=Remove Unused Bindings? DeleteBindingDialog.Message=This action will result in unused data bindings.\n\nDo you wish to remove unused bindings? -DeleteBindingDialog.ToggleMessage=&Don't show this message again +DeleteBindingDialog.ToggleMessage=&Remember my decision ########################################################### # Crosstab Outline Node AreaNodeProvider.ColumnArea=Column Area |

