Fix Work Item TDQ-7953 : remove the dependency of org.talend.core.ui in org.talend.dataprofiler.core

https://jira.talendforge.org/browse/TDQ-7953
create a new service to handle the tdq ui action

git-svn-id: http://talendforge.org/svn/tos/trunk@107624 f6f1c999-d317-4740-80b0-e6d1abc6f99e
This commit is contained in:
xqliu
2013-09-06 03:45:02 +00:00
parent e87a47581d
commit ce6dfb56c1
7 changed files with 54 additions and 41 deletions

View File

@@ -120,7 +120,7 @@ public interface ITDQRepositoryService extends IService {
/**
* create a hive connection(embedded or standalone) according to the IMetadataConnection, if it is not a hive
* connection type, return null.
*
*
* @param metadataConnection the db type should be hive
* @return a hive connection or null
*/
@@ -129,14 +129,8 @@ public interface ITDQRepositoryService extends IService {
// Add qiongli 2013-05-10 TDQ-7217
public boolean isDQEditorOpened(Item item);
public void updateContextView(boolean isBuildIn);
public void updateContextView(boolean isBuildIn, boolean isDisposeAll);
public void updateContextView(boolean isBuildIn, boolean isDisposeAll, boolean refreshView);
/**
*
*
* Add the software system update listener. The listener will be triggered when a new connection created, an
* existing connection reloaded, modifed with another type and updated from SVN repository. <br>
* Note that this listener will be registered only once a time when application startup.
@@ -144,14 +138,13 @@ public interface ITDQRepositoryService extends IService {
public void addSoftwareSystemUpdateListener();
/**
*
*
* Publish software system update event.
*
*
* @param databaseConnection
*/
public void publishSoftwareSystemUpdateEvent(DatabaseConnection databaseConnection);
/**
* After creating the database connection, will open the connection editor when this parameter= false (used in
* ConnectionTypePage, which will use DatabaseWizard but no need to open the connection editor after creating the db

View File

@@ -0,0 +1,25 @@
// ============================================================================
//
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core;
/**
* created by xqliu on Sep 5, 2013 Detailled comment
*/
public interface ITdqUiService extends IService {
public void updateContextView(boolean isBuildIn);
public void updateContextView(boolean isBuildIn, boolean isDisposeAll);
public void updateContextView(boolean isBuildIn, boolean isDisposeAll, boolean refreshView);
}

View File

@@ -20,7 +20,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.ITdqUiService;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
@@ -70,11 +70,10 @@ public class ContextAddParameterCommand extends Command {
((AbstractContextView) view).updateContextView(true);
}
// refresh context view of DQ
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
ITDQRepositoryService.class);
if (tdqRepositoryService != null) {
tdqRepositoryService.updateContextView(true);
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
ITdqUiService tdqUiService = (ITdqUiService) GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
if (tdqUiService != null) {
tdqUiService.updateContextView(true);
}
}
}

View File

@@ -17,7 +17,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.ITdqUiService;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.runtime.i18n.Messages;
@@ -55,11 +55,10 @@ public class ContextChangeDefaultCommand extends Command {
((AbstractContextView) view).updateContextView(true, false);
}
// refresh context view of DQ
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
ITDQRepositoryService.class);
if (tdqRepositoryService != null) {
tdqRepositoryService.updateContextView(true, false);
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
ITdqUiService tdqUiService = (ITdqUiService) GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
if (tdqUiService != null) {
tdqUiService.updateContextView(true, false);
}
}
}

View File

@@ -25,7 +25,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.ITdqUiService;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
@@ -106,11 +106,10 @@ public class ContextRemoveParameterCommand extends Command {
((AbstractContextView) view).updateContextView(true, false, false);
}
// refresh context view of DQ
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
ITDQRepositoryService.class);
if (tdqRepositoryService != null) {
tdqRepositoryService.updateContextView(true, false, false);
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
ITdqUiService tdqUiService = (ITdqUiService) GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
if (tdqUiService != null) {
tdqUiService.updateContextView(true, false, false);
}
}
}

View File

@@ -19,7 +19,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.ITdqUiService;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
import org.talend.core.runtime.i18n.Messages;
@@ -62,11 +62,10 @@ public class ContextRenameParameterCommand extends Command {
((AbstractContextView) view).updateContextView(true, false, false);
}
// refresh context view of DQ
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
ITDQRepositoryService.class);
if (tdqRepositoryService != null) {
tdqRepositoryService.updateContextView(true, false, false);
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
ITdqUiService tdqUiService = (ITdqUiService) GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
if (tdqUiService != null) {
tdqUiService.updateContextView(true, false, false);
}
}
}

View File

@@ -17,7 +17,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQRepositoryService;
import org.talend.core.ITdqUiService;
import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IContextParameter;
@@ -59,11 +59,10 @@ public class ContextTemplateModifyCommand extends Command {
((AbstractContextView) view).updateContextView(true, false);
}
// refresh context view of DQ
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault().getService(
ITDQRepositoryService.class);
if (tdqRepositoryService != null) {
tdqRepositoryService.updateContextView(true, false);
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITdqUiService.class)) {
ITdqUiService tdqUiService = (ITdqUiService) GlobalServiceRegister.getDefault().getService(ITdqUiService.class);
if (tdqUiService != null) {
tdqUiService.updateContextView(true, false);
}
}
}