summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxwu2012-03-21 05:25:03 (EDT)
committer mwu2012-03-21 05:25:03 (EDT)
commit60fa702dec556f2067b47691cb7b7a0b5ba9da8f (patch)
tree36580ef878ccb67dba82becdbe82f15cd8a1490c
parent606fdf593afef431cc41c2559a2ba645c58ec8f4 (diff)
downloadorg.eclipse.birt-60fa702dec556f2067b47691cb7b7a0b5ba9da8f.zip
org.eclipse.birt-60fa702dec556f2067b47691cb7b7a0b5ba9da8f.tar.gz
org.eclipse.birt-60fa702dec556f2067b47691cb7b7a0b5ba9da8f.tar.bz2
Summary:
Fix an issue 44456: after a new connection profile is created, it is not shown immediately in the relative path folder in "Navigator" View. Description of Issue: after a new connection profile is created, it is not shown immediately in the relative path folder in "Navigator" View. Description of Resolution: We'll refresh the report project folder each time a connection profile data source has been created. BUG(s) Resolved: 44456 Regression ( Yes/No ): No Manual Test Description: Manual Test
-rw-r--r--UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DataSourceSelectionPage.java67
-rw-r--r--UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DefaultDataSourceWizard.java25
2 files changed, 77 insertions, 15 deletions
diff --git a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DataSourceSelectionPage.java b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DataSourceSelectionPage.java
index b8bed7e..9141c8a 100644
--- a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DataSourceSelectionPage.java
+++ b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DataSourceSelectionPage.java
@@ -11,10 +11,12 @@
package org.eclipse.birt.report.designer.data.ui.datasource;
+import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.eclipse.birt.report.designer.core.model.SessionHandleAdapter;
import org.eclipse.birt.report.designer.data.ui.util.DTPUtil;
import org.eclipse.birt.report.designer.data.ui.util.DataSetProvider;
import org.eclipse.birt.report.designer.data.ui.util.DataUIConstants;
@@ -37,16 +39,23 @@ import org.eclipse.birt.report.model.api.command.ContentException;
import org.eclipse.birt.report.model.api.command.NameException;
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
import org.eclipse.birt.report.model.api.util.StringUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.design.DesignFactory;
import org.eclipse.datatools.connectivity.oda.design.DesignSessionRequest;
import org.eclipse.datatools.connectivity.oda.design.ResourceIdentifiers;
import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DataSourceDesignSession;
-import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;
import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DataSourceDesignSession.IDesignNameValidator;
+import org.eclipse.datatools.connectivity.oda.design.ui.designsession.DesignSessionUtil;
import org.eclipse.datatools.connectivity.oda.util.manifest.ExtensionManifest;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -581,6 +590,60 @@ public class DataSourceSelectionPage extends WizardPage
dataSourceIsCreated = false;
}
}
+
+ public boolean performFinish( )
+ {
+ if ( isCPSelected( ) )
+ {
+ IRunnableWithProgress op = new IRunnableWithProgress( ) {
+
+ public void run( IProgressMonitor monitor )
+ throws InvocationTargetException
+ {
+ try
+ {
+ IPath location = Path.fromOSString( SessionHandleAdapter.getInstance( )
+ .getReportDesignHandle( )
+ .getFileName( ) );
+ IFile resource = ResourcesPlugin.getWorkspace( )
+ .getRoot( )
+ .getFileForLocation( location );
+ if ( resource != null && resource.getProject( ) != null )
+ {
+ resource.getProject( )
+ .refreshLocal( IResource.DEPTH_INFINITE,
+ monitor );
+ }
+ }
+ catch ( CoreException e )
+ {
+ throw new InvocationTargetException( e );
+ }
+ finally
+ {
+ monitor.done( );
+ }
+ }
+ };
+ try
+ {
+ getContainer( ).run( true, false, op );
+ }
+ catch ( InterruptedException e )
+ {
+ ExceptionHandler.handle( e );
+ return false;
+ }
+ catch ( InvocationTargetException e )
+ {
+ Throwable realException = e.getTargetException( );
+ ExceptionHandler.handle( realException );
+ return false;
+ }
+ }
+
+ return this.createSelectedDataSource( );
+ }
/**
*
@@ -589,7 +652,7 @@ public class DataSourceSelectionPage extends WizardPage
public boolean createSelectedDataSource( )
{
createSelectedDataSourceInit( );
-
+
if ( isCPSelected( ) )
return createSelectedDataSourceODAV3( );
diff --git a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DefaultDataSourceWizard.java b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DefaultDataSourceWizard.java
index fb3ee97..9ff0b13 100644
--- a/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DefaultDataSourceWizard.java
+++ b/UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/datasource/DefaultDataSourceWizard.java
@@ -13,7 +13,6 @@ package org.eclipse.birt.report.designer.data.ui.datasource;
import org.eclipse.jface.wizard.Wizard;
-
/**
* TODO: Please document
*
@@ -22,24 +21,24 @@ import org.eclipse.jface.wizard.Wizard;
public class DefaultDataSourceWizard extends Wizard
{
- private DataSourceSelectionPage page = new DataSourceSelectionPage("datasourceselection"); //$NON-NLS-1$
+ private DataSourceSelectionPage page = new DataSourceSelectionPage( "datasourceselection" ); //$NON-NLS-1$
- /**
- * Constructor
- */
- public DefaultDataSourceWizard()
- {
- super();
- addPage(page);
- setForcePreviousAndNextButtons( true );
- }
+ /**
+ * Constructor
+ */
+ public DefaultDataSourceWizard( )
+ {
+ super( );
+ addPage( page );
+ setForcePreviousAndNextButtons( true );
+ }
- /*
+ /*
*
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
public boolean performFinish( )
{
- return page.createSelectedDataSource( );
+ return page.performFinish( );
}
}