summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorning.zhang2012-03-15 05:26:11 (EDT)
committer dgao2012-03-15 05:26:11 (EDT)
commit651ab4963ca9d542fef4261f1a38835481a377fe (patch)
tree35e68c3522096850e9aba4fee6b8d04c10f05c80
parentb01f35530789b773ee03ad39579407a052b21206 (diff)
downloadorg.eclipse.birt-651ab4963ca9d542fef4261f1a38835481a377fe.zip
org.eclipse.birt-651ab4963ca9d542fef4261f1a38835481a377fe.tar.gz
org.eclipse.birt-651ab4963ca9d542fef4261f1a38835481a377fe.tar.bz2
Provides options in the preference page to enable or disable the default themes feature when creating a report design.
This option only applies if the rptlibrary file exists.
-rw-r--r--UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/nls/messages.properties3
-rw-r--r--UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardTemplateChoicePage.java17
-rw-r--r--UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/ReportPlugin.java2
-rw-r--r--UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/ui/preferences/GeneralConfigurationBlock.java48
4 files changed, 67 insertions, 3 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 52a0a38..a4d66fe 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
@@ -4743,7 +4743,10 @@ GeneralConfigurationBlock.message.general.description=General settings for repor
GeneralConfigurationBlock.button.text.enable.gradient=Enable &gradient selection
GeneralConfigurationBlock.button.text.enable.animation=Enable a&nimated selection
GeneralConfigurationBlock.group.label=Prompt
+GeneralConfigurationBlock.group.defaultThemes=Default themes library
GeneralConfigurationBlock.button.text.prompt=Show &prompt after opening library file.
+GeneralConfigurationBlock.button.text.defaultTheme.enable=Enable default &themes library.
+GeneralConfigurationBlock.button.text.defaultTheme.include=&Include the default themes.
GeneralConfigurationBlock.move.binding.group=Move local bindings to parent for better performance
GeneralConfigurationBlock.move.binding.always=Al&ways
GeneralConfigurationBlock.move.binding.never=Ne&ver
diff --git a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardTemplateChoicePage.java b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardTemplateChoicePage.java
index c19b8d7..920102c 100644
--- a/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardTemplateChoicePage.java
+++ b/UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/wizards/WizardTemplateChoicePage.java
@@ -104,6 +104,8 @@ public class WizardTemplateChoicePage extends WizardPage implements
private static final String MESSAGE_SHOW_CHEATSHEET = Messages.getString( "WizardTemplateChoicePage.label.ShowCheatSheets" ); //$NON-NLS-1$)
+ private static final String ENABLED = "true"; //$NON-NLS-1$
+
private ImageCanvas previewCanvas;
private Button chkBox;
@@ -348,11 +350,20 @@ public class WizardTemplateChoicePage extends WizardPage implements
chkBox.setLayoutData( data );
defaultLibraryHandle = getDefaultLibraryHandleFromResource( );
- if (defaultLibraryHandle != null)
+
+ String value = ReportPlugin.getDefault( )
+ .getPreferenceStore( )
+ .getString( ReportPlugin.LIBRARY_DEFAULT_THEME_ENABLE );
+
+ if ( defaultLibraryHandle != null && ENABLED.equals( value ) )
{
+ String state = ReportPlugin.getDefault( )
+ .getPreferenceStore( )
+ .getString( ReportPlugin.LIBRARY_DEFAULT_THEME_INCLUDE );
+
useDefaultLibraryBox = new Button( composite, SWT.CHECK );
- useDefaultLibraryBox.setText( "&Include the default themes" );
- useDefaultLibraryBox.setSelection( true );
+ useDefaultLibraryBox.setText( "&Include the default themes" ); //$NON-NLS-1$
+ useDefaultLibraryBox.setSelection( ENABLED.equals(state) );
}
// bidi_hcg start
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 31afc66..2cfcbc0 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,8 @@ 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_DEFAULT_THEME_ENABLE = "designer.library.preference.libraries.enable.default.theme.preferencestore"; //$NON-NLS-1$
+ public static final String LIBRARY_DEFAULT_THEME_INCLUDE = "designer.library.preference.libraries.include.default.theme.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$
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 7f4e005..fa50d88 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
@@ -15,9 +15,13 @@ import org.eclipse.birt.report.designer.internal.ui.editors.schematic.border.Sel
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.birt.report.designer.ui.ReportPlugin;
import org.eclipse.birt.report.designer.ui.util.PixelConverter;
+import org.eclipse.birt.report.designer.util.DEUtil;
+import org.eclipse.birt.report.model.api.LibraryHandle;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -35,6 +39,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_LIBRARY_WARNING = getReportKey( ReportPlugin.LIBRARY_WARNING_PREFERENCE );
+ private final Key PREF_LIBRARY_DEFAULT_THEME_ENABLE = getReportKey( ReportPlugin.LIBRARY_DEFAULT_THEME_ENABLE );
+ private final Key PREF_LIBRARY_DEFAULT_THEME_INCLUDE = getReportKey( ReportPlugin.LIBRARY_DEFAULT_THEME_INCLUDE );
private final Key PREF_LIBRARY_MOVE_BINDINGS = getReportKey( ReportPlugin.LIBRARY_MOVE_BINDINGS_PREFERENCE );
private static final String ENABLED = "true"; //$NON-NLS-1$
@@ -44,6 +50,8 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock
private Button ckGradient;
+ private LibraryHandle defaultLibraryHandle;
+
public GeneralConfigurationBlock( IStatusChangeListener context,
IProject project )
{
@@ -57,6 +65,8 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock
PREF_ENABLE_GRADIENT,
PREF_ENABLE_ANIMATION,
PREF_LIBRARY_WARNING,
+ PREF_LIBRARY_DEFAULT_THEME_ENABLE,
+ PREF_LIBRARY_DEFAULT_THEME_INCLUDE,
PREF_LIBRARY_MOVE_BINDINGS
};
return keys;
@@ -141,6 +151,38 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock
promptValues,
0 );
+ if ( hasDefaultLibraryHandle( ) )
+ {
+ Group themeGroup = new Group(pageContent, SWT.NONE);
+ themeGroup.setText( Messages.getString( "GeneralConfigurationBlock.group.defaultThemes" ) );
+ themeGroup.setLayoutData( new GridData(GridData.FILL_HORIZONTAL) );
+ themeGroup.setLayout( new GridLayout() );
+
+ final Button btnEnable = addCheckBox( themeGroup,
+ Messages.getString( "GeneralConfigurationBlock.button.text.defaultTheme.enable" ), //$NON-NLS-1$
+ PREF_LIBRARY_DEFAULT_THEME_ENABLE,
+ enableDisableValues,
+ 0 );
+ final Button btnInclude = addCheckBox( themeGroup,
+ Messages.getString( "GeneralConfigurationBlock.button.text.defaultTheme.include" ), //$NON-NLS-1$
+ PREF_LIBRARY_DEFAULT_THEME_INCLUDE,
+ enableDisableValues,
+ 20 );
+
+ btnInclude.setEnabled(btnEnable.getSelection());
+ btnEnable.addSelectionListener(new SelectionListener(){
+
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+
+ public void widgetSelected(SelectionEvent arg0) {
+ btnInclude.setEnabled(btnEnable.getSelection());
+ }
+
+ });
+
+ }
String[] labels = new String[]{
Messages.getString( "GeneralConfigurationBlock.move.binding.group" ), //$NON-NLS-1$
Messages.getString( "GeneralConfigurationBlock.move.binding.always" ), //$NON-NLS-1$
@@ -206,4 +248,10 @@ public class GeneralConfigurationBlock extends OptionsConfigurationBlock
null,
getValue( PREF_ENABLE_ANIMATION ) );
}
+
+ private boolean hasDefaultLibraryHandle( )
+ {
+ defaultLibraryHandle = DEUtil.getDefaultLibraryHandle( );
+ return defaultLibraryHandle != null ? true : false;
+ }
}