Search in sources :

Example 1 with IMigrationToolService

use of org.talend.core.model.migration.IMigrationToolService in project tdi-studio-se by Talend.

the class RepositoryService method openLoginDialog.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.repository.model.IRepositoryService#openLoginDialog()
     */
@Override
public void openLoginDialog() {
    if (isloginDialogDisabled()) {
        return;
    }
    if (CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY) != null) {
        return;
    }
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    boolean logged = false;
    LoginDialogV2 loginDialog = new LoginDialogV2(shell);
    // PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(true);
    logged = loginDialog.open() == LoginDialogV2.OK;
    if (logged) {
        // addCommand();
        new DisableLanguageActions().earlyStartup();
        new BindingActions().bind();
        IMigrationToolService toolService = CorePlugin.getDefault().getMigrationToolService();
        toolService.executeMigration(SwitchProjectAction.PLUGIN_MODEL);
        IRunProcessService runService = CorePlugin.getDefault().getRunProcessService();
        runService.deleteAllJobs(SwitchProjectAction.PLUGIN_MODEL);
        CorePlugin.getDefault().getCodeGeneratorService().initializeTemplates();
        CorePlugin.getDefault().getDesignerCoreService().synchronizeDesignerUI(new PropertyChangeEvent(this, IComponentConstants.NORMAL, null, null));
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) PropertyChangeEvent(java.beans.PropertyChangeEvent) IMigrationToolService(org.talend.core.model.migration.IMigrationToolService) DisableLanguageActions(org.talend.core.model.action.DisableLanguageActions) BindingActions(org.talend.repository.plugin.integration.BindingActions) IRunProcessService(org.talend.designer.runprocess.IRunProcessService) LoginDialogV2(org.talend.repository.ui.login.LoginDialogV2)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)1 Shell (org.eclipse.swt.widgets.Shell)1 DisableLanguageActions (org.talend.core.model.action.DisableLanguageActions)1 IMigrationToolService (org.talend.core.model.migration.IMigrationToolService)1 IRunProcessService (org.talend.designer.runprocess.IRunProcessService)1 BindingActions (org.talend.repository.plugin.integration.BindingActions)1 LoginDialogV2 (org.talend.repository.ui.login.LoginDialogV2)1