Search in sources :

Example 1 with WorkflowGroupSelectionDialog

use of org.knime.workbench.ui.wizards.workflowgroup.WorkflowGroupSelectionDialog in project knime-core by knime.

the class NewProjectWizardPage method handleBrowseButton.

private void handleBrowseButton() {
    WorkflowGroupSelectionDialog dialog = new WorkflowGroupSelectionDialog(getShell());
    dialog.setInitialSelection(new Path(m_destinationUI.getText()));
    if (dialog.open() == IDialogConstants.OK_ID) {
        IContainer c = dialog.getSelectedWorkflowGroup();
        m_destinationUI.setText(c.getFullPath().toString());
    }
    dialogChanged();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) WorkflowGroupSelectionDialog(org.knime.workbench.ui.wizards.workflowgroup.WorkflowGroupSelectionDialog) IContainer(org.eclipse.core.resources.IContainer)

Example 2 with WorkflowGroupSelectionDialog

use of org.knime.workbench.ui.wizards.workflowgroup.WorkflowGroupSelectionDialog in project knime-core by knime.

the class WorkflowImportSelectionPage method handleWorkflowGroupBrowseButtonPressed.

private void handleWorkflowGroupBrowseButtonPressed() {
    // get the value from the text field
    String wfGroupPath = m_targetTextUI.getText();
    IPath initialPath = ResourcesPlugin.getWorkspace().getRoot().getFullPath();
    // if not yet set take workflow root
    if (wfGroupPath != null && !wfGroupPath.trim().isEmpty()) {
        initialPath = new Path(wfGroupPath);
    }
    WorkflowGroupSelectionDialog dialog = new WorkflowGroupSelectionDialog(getShell());
    dialog.setInitialSelection(initialPath);
    int returnCode = dialog.open();
    if (returnCode == IDialogConstants.OK_ID) {
        // set the newly selected workflow group as destination
        IContainer target = dialog.getSelectedWorkflowGroup();
        if (target != null && !target.equals(ResourcesPlugin.getWorkspace().getRoot())) {
            m_targetTextUI.setText(target.getFullPath().toString());
        } else {
            m_targetTextUI.setText(Path.ROOT.toString());
        }
    }
    validateWorkflows();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) WorkflowGroupSelectionDialog(org.knime.workbench.ui.wizards.workflowgroup.WorkflowGroupSelectionDialog) IContainer(org.eclipse.core.resources.IContainer)

Aggregations

IContainer (org.eclipse.core.resources.IContainer)2 IPath (org.eclipse.core.runtime.IPath)2 Path (org.eclipse.core.runtime.Path)2 WorkflowGroupSelectionDialog (org.knime.workbench.ui.wizards.workflowgroup.WorkflowGroupSelectionDialog)2