summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui.chai2012-03-15 05:41:09 (EDT)
committer mwu2012-03-15 05:41:09 (EDT)
commit32aec522c0901b5b69b0c7282f2dc8889dd70ada (patch)
tree380ce5909c3c3b66df6c72779ed148a832776ed4
parentb01f35530789b773ee03ad39579407a052b21206 (diff)
downloadorg.eclipse.birt-32aec522c0901b5b69b0c7282f2dc8889dd70ada.zip
org.eclipse.birt-32aec522c0901b5b69b0c7282f2dc8889dd70ada.tar.gz
org.eclipse.birt-32aec522c0901b5b69b0c7282f2dc8889dd70ada.tar.bz2
make the system's view and the user's view identical[46747]
-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
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/provider/JdbcMetaDataProvider.java39
5 files changed, 94 insertions, 15 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;
+ }
}
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/provider/JdbcMetaDataProvider.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/provider/JdbcMetaDataProvider.java
index 2e3a14b..8469fa6 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/provider/JdbcMetaDataProvider.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/provider/JdbcMetaDataProvider.java
@@ -44,6 +44,21 @@ public class JdbcMetaDataProvider
private static Logger logger = Logger.getLogger( JdbcMetaDataProvider.class.getName( ) );
private static JdbcMetaDataProvider instance = null;
+
+ private String getCatalog( ) throws SQLException
+ {
+ // if the data source has no Catalog to store table, and the table is
+ // stored in the root(seldom),the connection.getCatalog( ) will return
+ // "". in this case if the user want to get all the 'root' table, they
+ // needs to use Catalog= null to search. as a result here is the
+ // connection.getCatalog( ) is "", to make user convenient to do it,
+ // just set it as null.
+ if ( connection.getCatalog( ) != null
+ && connection.getCatalog( ).trim( ).length( ) == 0 )
+ return null;
+ else
+ return connection.getCatalog( );
+ }
private JdbcMetaDataProvider(String driverClass, String url, String userName, String password, Properties props )
{
@@ -314,7 +329,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getColumns(
- connection.getCatalog( ), schemaPattern, tableNamePattern, columnNamePattern );
+ getCatalog( ), schemaPattern, tableNamePattern, columnNamePattern );
}
catch ( SQLException e )
{
@@ -329,7 +344,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getColumns(
- connection.getCatalog( ), schemaPattern, tableNamePattern, columnNamePattern );
+ getCatalog( ), schemaPattern, tableNamePattern, columnNamePattern );
}
catch ( SQLException e )
{
@@ -337,7 +352,7 @@ public class JdbcMetaDataProvider
{
reconnect( );
return connection.getMetaData( )
- .getColumns( connection.getCatalog( ),
+ .getColumns( getCatalog( ),
schemaPattern,
tableNamePattern,
columnNamePattern );
@@ -373,7 +388,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getProcedures(
- connection.getCatalog( ), schemaPattern, procedureNamePattern );
+ getCatalog( ), schemaPattern, procedureNamePattern );
}
catch ( SQLException e )
{
@@ -388,7 +403,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getProcedures(
- connection.getCatalog( ), schemaPattern, procedureNamePattern );
+ getCatalog( ), schemaPattern, procedureNamePattern );
}
catch ( SQLException e )
{
@@ -396,7 +411,7 @@ public class JdbcMetaDataProvider
{
reconnect( );
return connection.getMetaData( ).getProcedures(
- connection.getCatalog( ), schemaPattern, procedureNamePattern );
+ getCatalog( ), schemaPattern, procedureNamePattern );
}
catch ( Exception e1 )
{
@@ -423,7 +438,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getProcedureColumns(
- connection.getCatalog( ), schemaPattern, procedureNamePattern, columnNamePattern );
+ getCatalog( ), schemaPattern, procedureNamePattern, columnNamePattern );
}
catch ( SQLException e )
{
@@ -438,7 +453,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getProcedureColumns(
- connection.getCatalog( ), schemaPattern, procedureNamePattern, columnNamePattern );
+ getCatalog( ), schemaPattern, procedureNamePattern, columnNamePattern );
}
catch ( SQLException e )
{
@@ -446,7 +461,7 @@ public class JdbcMetaDataProvider
{
reconnect( );
return connection.getMetaData( )
- .getProcedureColumns( connection.getCatalog( ),
+ .getProcedureColumns( getCatalog( ),
schemaPattern,
procedureNamePattern,
columnNamePattern );
@@ -482,7 +497,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getTables(
- connection.getCatalog( ), schemaPattern, namePattern, types );
+ getCatalog( ), schemaPattern, namePattern, types );
}
catch ( SQLException e )
{
@@ -497,7 +512,7 @@ public class JdbcMetaDataProvider
try
{
return connection.getMetaData( ).getTables(
- connection.getCatalog( ), schemaPattern, namePattern, types );
+ getCatalog( ), schemaPattern, namePattern, types );
}
catch ( SQLException e )
{
@@ -505,7 +520,7 @@ public class JdbcMetaDataProvider
{
reconnect( );
return connection.getMetaData( )
- .getTables( connection.getCatalog( ),
+ .getTables( getCatalog( ),
schemaPattern,
namePattern,
types );