Search in sources :

Example 1 with RouteResourceSelectionDialog

use of org.talend.camel.designer.dialog.RouteResourceSelectionDialog in project tesb-studio-se by Talend.

the class RouteResourceController method createButtonCommand.

/**
     * 
     * @param source
     * @return
     */
private PropertyChangeCommand createButtonCommand(Button button) {
    RouteResourceSelectionDialog dialog = new RouteResourceSelectionDialog(button.getShell());
    selectNodeIfExists(button, dialog);
    if (dialog.open() == Window.OK) {
        IRepositoryViewObject repositoryObject = dialog.getResult().getObject();
        // refreshItemeProperty(repositoryObject);
        final Item item = repositoryObject.getProperty().getItem();
        String id = item.getProperty().getId();
        String paramName = (String) button.getData(PARAMETER_NAME);
        return new PropertyChangeCommand(elem, paramName, id);
    }
    return null;
}
Also used : Item(org.talend.core.model.properties.Item) PropertyChangeCommand(org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) RouteResourceSelectionDialog(org.talend.camel.designer.dialog.RouteResourceSelectionDialog)

Example 2 with RouteResourceSelectionDialog

use of org.talend.camel.designer.dialog.RouteResourceSelectionDialog in project tesb-studio-se by Talend.

the class ManageRouteResourcePanel method addData.

protected void addData() {
    RouteResourceSelectionDialog dialog = new RouteResourceSelectionDialog(getShell());
    if (Dialog.OK == dialog.open()) {
        Item item = dialog.getResult().getObject().getProperty().getItem();
        if (item instanceof RouteResourceItem) {
            for (ResourceDependencyModel rsmodel : getInput()) {
                if (rsmodel.getItem().getProperty().getId().equals(item.getProperty().getId())) {
                    resourcesTV.setSelection(new StructuredSelection(rsmodel));
                    return;
                }
            }
            ResourceDependencyModel model = new ResourceDependencyModel((RouteResourceItem) item);
            getInput().add(model);
            resourcesTV.refresh();
            resourcesTV.setSelection(new StructuredSelection(model));
            fireDependenciesChangedListener();
        }
    }
}
Also used : RouteResourceItem(org.talend.camel.core.model.camelProperties.RouteResourceItem) Item(org.talend.core.model.properties.Item) ToolItem(org.eclipse.swt.widgets.ToolItem) RouteResourceItem(org.talend.camel.core.model.camelProperties.RouteResourceItem) ResourceDependencyModel(org.talend.designer.camel.resource.core.model.ResourceDependencyModel) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) RouteResourceSelectionDialog(org.talend.camel.designer.dialog.RouteResourceSelectionDialog)

Aggregations

RouteResourceSelectionDialog (org.talend.camel.designer.dialog.RouteResourceSelectionDialog)2 Item (org.talend.core.model.properties.Item)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ToolItem (org.eclipse.swt.widgets.ToolItem)1 RouteResourceItem (org.talend.camel.core.model.camelProperties.RouteResourceItem)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 ResourceDependencyModel (org.talend.designer.camel.resource.core.model.ResourceDependencyModel)1 PropertyChangeCommand (org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand)1