Search in sources :

Example 11 with DummyDynamicMonitor

use of org.talend.designer.maven.aether.DummyDynamicMonitor in project tbd-studio-se by Talend.

the class DynamicDistributionPreferenceForm method onDeleteBtnPressed.

private void onDeleteBtnPressed() {
    IStructuredSelection selection = (IStructuredSelection) versionCombo.getSelection();
    final IDynamicPlugin dynamicPlugin = (IDynamicPlugin) selection.getFirstElement();
    boolean agree = MessageDialog.openConfirm(getShell(), // $NON-NLS-1$
    Messages.getString("DynamicDistributionPreferenceForm.form.deleteExistingConfig.confirm.dialog.title"), // $NON-NLS-1$
    Messages.getString(// $NON-NLS-1$
    "DynamicDistributionPreferenceForm.form.deleteExistingConfig.confirm.dialog.message", dynamicPlugin.getPluginConfiguration().getName()));
    if (agree) {
        try {
            doDelete(dynamicPlugin);
            IDynamicMonitor monitor = new DummyDynamicMonitor();
            refreshVersionList(monitor);
        } catch (Throwable e) {
            ExceptionHandler.process(e);
            String message = e.getMessage();
            if (StringUtils.isEmpty(message)) {
                // $NON-NLS-1$
                message = Messages.getString("ExceptionDialog.message.empty");
            }
            // $NON-NLS-1$
            ExceptionMessageDialog.openError(getShell(), Messages.getString("ExceptionDialog.title"), message, e);
        }
    }
}
Also used : IDynamicPlugin(org.talend.core.runtime.dynamic.IDynamicPlugin) DummyDynamicMonitor(org.talend.designer.maven.aether.DummyDynamicMonitor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IDynamicMonitor(org.talend.designer.maven.aether.IDynamicMonitor)

Example 12 with DummyDynamicMonitor

use of org.talend.designer.maven.aether.DummyDynamicMonitor in project tbd-studio-se by Talend.

the class DynamicDistributionOptionForm method getNamePluginMap.

private Map<String, IDynamicPlugin> getNamePluginMap() throws Exception {
    if (namePluginMap == null || namePluginMap.isEmpty()) {
        namePluginMap = new HashMap<>();
        DynamicDistributionSetupData dynamicBuildConfigurationData = getDynamicDistributionSetupData();
        if (allBuiltinDynamicPlugins == null || allBuiltinDynamicPlugins.isEmpty()) {
            copyAllUsersDynamicPlugins(new DummyDynamicMonitor(), dynamicBuildConfigurationData.getDynamicDistributionsGroup());
        }
        if (allBuiltinDynamicPlugins != null) {
            for (IDynamicPlugin plugin : allBuiltinDynamicPlugins) {
                IDynamicPluginConfiguration pluginConfiguration = plugin.getPluginConfiguration();
                String name = pluginConfiguration.getName();
                namePluginMap.put(name, plugin);
            }
        }
        if (allCurrentUsersDynamicPlugins != null) {
            for (IDynamicPlugin plugin : allCurrentUsersDynamicPlugins) {
                IDynamicPluginConfiguration pluginConfiguration = plugin.getPluginConfiguration();
                String name = pluginConfiguration.getName();
                namePluginMap.put(name, plugin);
            }
        }
    }
    return namePluginMap;
}
Also used : IDynamicPlugin(org.talend.core.runtime.dynamic.IDynamicPlugin) DummyDynamicMonitor(org.talend.designer.maven.aether.DummyDynamicMonitor) DynamicDistributionSetupData(org.talend.repository.hadoopcluster.ui.dynamic.DynamicDistributionSetupData) IDynamicPluginConfiguration(org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)

Example 13 with DummyDynamicMonitor

use of org.talend.designer.maven.aether.DummyDynamicMonitor in project tbd-studio-se by Talend.

the class DynamicDistributionOptionPage method createControl.

@Override
public void createControl(Composite parent) {
    IDynamicMonitor monitor = new DummyDynamicMonitor();
    AbstractDynamicDistributionForm.ICheckListener checkListener = new ICheckListener() {

        @Override
        public void showMessage(String message, int level) {
            setMessage(message, level);
        }

        @Override
        public void updateButtons() {
            getContainer().updateButtons();
        }

        @Override
        public String getMessage() {
            return DynamicDistributionOptionPage.this.getMessage();
        }

        @Override
        public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws Exception {
            getContainer().run(fork, cancelable, runnable);
        }
    };
    AbstractDynamicDistributionForm setupForm = new DynamicDistributionOptionForm(parent, SWT.NONE, getDynamicBuildConfigurationData(), monitor);
    setupForm.setCheckListener(checkListener);
    setControl(setupForm);
    setCurrentForm(setupForm);
    setPageComplete(false);
}
Also used : ICheckListener(org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener) ICheckListener(org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener) DummyDynamicMonitor(org.talend.designer.maven.aether.DummyDynamicMonitor) AbstractDynamicDistributionForm(org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm) IDynamicMonitor(org.talend.designer.maven.aether.IDynamicMonitor) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) DynamicDistributionOptionForm(org.talend.repository.hadoopcluster.ui.dynamic.form.DynamicDistributionOptionForm)

Aggregations

DummyDynamicMonitor (org.talend.designer.maven.aether.DummyDynamicMonitor)13 IDynamicMonitor (org.talend.designer.maven.aether.IDynamicMonitor)10 IDynamicPlugin (org.talend.core.runtime.dynamic.IDynamicPlugin)6 IDynamicPluginConfiguration (org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)5 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)4 AbstractDynamicDistributionForm (org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm)4 ICheckListener (org.talend.repository.hadoopcluster.ui.dynamic.form.AbstractDynamicDistributionForm.ICheckListener)4 LinkedList (java.util.LinkedList)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Entry (java.util.Map.Entry)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 VersionStringComparator (org.talend.designer.maven.aether.comparator.VersionStringComparator)2 DynamicDistributionSetupData (org.talend.repository.hadoopcluster.ui.dynamic.DynamicDistributionSetupData)2 DynamicDistributionPreferenceForm (org.talend.repository.hadoopcluster.ui.dynamic.form.DynamicDistributionPreferenceForm)2 File (java.io.File)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1