Search in sources :

Example 1 with NewOrEditDependencyDialog

use of org.talend.camel.designer.ui.editor.dependencies.dialog.NewOrEditDependencyDialog in project tesb-studio-se by Talend.

the class CamelDependenciesPanel method editSelected.

private void editSelected() {
    final ManifestItem selected = (ManifestItem) ((IStructuredSelection) tableViewer.getSelection()).getFirstElement();
    final NewOrEditDependencyDialog dialog = new NewOrEditDependencyDialog(getInput(), selected, getShell(), type);
    if (dialog.open() == Dialog.OK) {
        ManifestItem item = dialog.getManifestItem();
        selected.setName(item.getName());
        selected.setOptional(item.isOptional());
        selected.setVersion(item.getVersion());
        tableViewer.update(selected, null);
        fireDependenciesChangedListener();
    }
}
Also used : ManifestItem(org.talend.designer.camel.dependencies.core.model.ManifestItem) NewOrEditDependencyDialog(org.talend.camel.designer.ui.editor.dependencies.dialog.NewOrEditDependencyDialog)

Example 2 with NewOrEditDependencyDialog

use of org.talend.camel.designer.ui.editor.dependencies.dialog.NewOrEditDependencyDialog in project tesb-studio-se by Talend.

the class CamelDependenciesPanel method addNewItem.

private void addNewItem() {
    final Collection<ManifestItem> input = (Collection<ManifestItem>) getInput();
    NewOrEditDependencyDialog dialog = new NewOrEditDependencyDialog(input, getShell(), type);
    if (dialog.open() == Dialog.OK) {
        final ManifestItem addedItem = dialog.getManifestItem();
        input.add(addedItem);
        tableViewer.refresh();
        tableViewer.setSelection(new StructuredSelection(addedItem));
        tableViewer.getTable().showSelection();
        tableViewer.getTable().setFocus();
        fireDependenciesChangedListener();
    }
}
Also used : ManifestItem(org.talend.designer.camel.dependencies.core.model.ManifestItem) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) Collection(java.util.Collection) NewOrEditDependencyDialog(org.talend.camel.designer.ui.editor.dependencies.dialog.NewOrEditDependencyDialog)

Aggregations

NewOrEditDependencyDialog (org.talend.camel.designer.ui.editor.dependencies.dialog.NewOrEditDependencyDialog)2 ManifestItem (org.talend.designer.camel.dependencies.core.model.ManifestItem)2 Collection (java.util.Collection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1