Search in sources :

Example 1 with ComponentSettingsView

use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.

the class ConnectionPart method setSelected.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#setSelected(int)
     */
@Override
public void setSelected(final int value) {
    super.setSelected(value);
    List cl = this.getChildren();
    for (int i = 0; i < cl.size(); i++) {
        if (((EditPart) cl.get(i)).getSelected() != value) {
            ((EditPart) cl.get(i)).setSelected(value);
        }
    }
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (value == SELECTED_PRIMARY) {
        IViewPart view = page.findView(ComponentSettingsView.ID);
        if (view != null) {
            ComponentSettingsView compSettings = (ComponentSettingsView) view;
            compSettings.setElement((Connection) getModel());
            CodeView.refreshCodeView((Connection) getModel());
        }
    } else if (value == SELECTED_NONE) {
        IViewPart view = page.findView(ComponentSettingsView.ID);
        if (view != null) {
            ComponentSettingsView compSettings = (ComponentSettingsView) view;
            compSettings.cleanDisplay();
        }
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) AbstractConnectionEditPart(org.eclipse.gef.editparts.AbstractConnectionEditPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ArrayList(java.util.ArrayList) List(java.util.List) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Example 2 with ComponentSettingsView

use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.

the class AbstractElementPropertySectionController method fixedCursorPosition.

/**
     * qzhang Comment method "fixedCursorPosition".
     *
     * @param param
     * @param labelText
     * @param value
     * @param valueChanged
     */
protected void fixedCursorPosition(IElementParameter param, Control labelText, Object value, boolean valueChanged) {
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    IWorkbenchPart workbenchPart = page.getActivePart();
    if ((workbenchPart instanceof PropertySheet) || (workbenchPart instanceof JobSettingsView) || (workbenchPart instanceof ComponentSettingsView)) {
        Object control = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getActiveControl();
        if (param.getName().equals(control) && valueChanged && !param.isRepositoryValueUsed()) {
            String previousText = editionControlHelper.undoRedoHelper.typedTextCommandExecutor.getPreviousText2();
            String currentText = String.valueOf(value);
            labelText.setFocus();
            ControlUtils.setCursorPosition(labelText, getcursorPosition(previousText, currentText));
        }
    }
}
Also used : JobSettingsView(org.talend.designer.core.ui.views.jobsettings.JobSettingsView) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Example 3 with ComponentSettingsView

use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.

the class DesignerCoreService method refreshComponentView.

@Override
public void refreshComponentView() {
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    IViewPart view = page.findView(ComponentSettingsView.ID);
    if (view == null) {
        // don't do anything. before it made the view appear for nothing even in other product like DQ.
        return;
    }
    if (view != null && view instanceof ComponentSettingsView) {
        ComponentSettingsView settingView = (ComponentSettingsView) view;
        Element element = settingView.getElement();
        if (element != null) {
            settingView.cleanDisplay();
            settingView.setElement(element);
        }
    }
    List<ComponentSettingsView> otherViews = JobTemplateViewsAndProcessUtil.getInstance().getAllViews();
    if (otherViews == null || otherViews.isEmpty()) {
        return;
    }
    for (ComponentSettingsView v : otherViews) {
        if (v.getParent() != null && !v.getParent().isDisposed()) {
            Element elem = v.getElement();
            if (elem != null) {
                v.cleanDisplay();
                v.setElement(elem);
            }
        }
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) Element(org.talend.core.model.process.Element) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Example 4 with ComponentSettingsView

use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.

the class NodeLabelEditPart method propertyChange.

/*
     * (non-Javadoc)
     * 
     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
     */
public void propertyChange(final PropertyChangeEvent evt) {
    String request = evt.getPropertyName();
    if (request.equals(NodeLabel.OFFSET_CHANGE)) {
        //$NON-NLS-1$ //$NON-NLS-2$
        refreshVisuals();
        getParent().refresh();
    }
    if (request.equals(NodeLabel.TEXT_CHANGE)) {
        refreshVisuals();
        // set the new size to update the node container
        ((NodeLabel) getModel()).setLabelSize(((SimpleHtmlFigure) figure).getPreferredSize());
        NodeLabel label = (NodeLabel) getModel();
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ISQLBuilderService.class)) {
            ISQLBuilderService service = (ISQLBuilderService) GlobalServiceRegister.getDefault().getService(ISQLBuilderService.class);
            service.updateSqlBuilderDialogTitle(label.getLabelText(), label.getNode().getProcess().getName(), label.getNode().getUniqueName());
        }
        getParent().refresh();
        // refresh the title of component setting view.
        ComponentSettingsView viewer = (ComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ComponentSettingsView.ID);
        if (viewer != null) {
            viewer.updatePropertiesViewerTitle();
        }
    }
    if (request.equals(NodeLabel.LOCATION)) {
        //$NON-NLS-1$
        refreshVisuals();
        getParent().refresh();
    }
    if (request.equals(EParameterName.ACTIVATE.getName())) {
        if (((NodeLabel) getModel()).isActivate()) {
            ((SimpleHtmlFigure) figure).setAlpha(-1);
            ((SimpleHtmlFigure) figure).repaint();
            refreshVisuals();
        } else {
            ((SimpleHtmlFigure) figure).setAlpha(Node.ALPHA_VALUE);
            ((SimpleHtmlFigure) figure).repaint();
            refreshVisuals();
        }
    }
    EditPart editPart = getParent();
    if (editPart != null) {
        while ((!(editPart instanceof ProcessPart)) && (!(editPart instanceof SubjobContainerPart))) {
            editPart = editPart.getParent();
        }
        if (editPart instanceof SubjobContainerPart) {
            editPart.refresh();
        }
    }
}
Also used : AbstractGraphicalEditPart(org.eclipse.gef.editparts.AbstractGraphicalEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) ProcessPart(org.talend.designer.core.ui.editor.process.ProcessPart) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView) SubjobContainerPart(org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainerPart) ISQLBuilderService(org.talend.core.ui.services.ISQLBuilderService) SimpleHtmlFigure(org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)

Example 5 with ComponentSettingsView

use of org.talend.designer.core.ui.views.properties.ComponentSettingsView in project tdi-studio-se by Talend.

the class ShowBreakpointAction method run.

public void run() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
    ComponentSettingsView view;
    try {
        view = (ComponentSettingsView) page.showView(ComponentSettingsView.ID);
        view.setElement(connection);
        view.selectTab(EComponentCategory.BREAKPOINT);
    } catch (PartInitException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException) ComponentSettingsView(org.talend.designer.core.ui.views.properties.ComponentSettingsView)

Aggregations

ComponentSettingsView (org.talend.designer.core.ui.views.properties.ComponentSettingsView)8 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)6 ArrayList (java.util.ArrayList)2 EditPart (org.eclipse.gef.EditPart)2 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)2 IViewPart (org.eclipse.ui.IViewPart)2 Process (org.talend.designer.core.ui.editor.process.Process)2 Iterator (java.util.Iterator)1 List (java.util.List)1 Disposable (org.eclipse.gef.Disposable)1 GraphicalViewer (org.eclipse.gef.GraphicalViewer)1 AbstractConnectionEditPart (org.eclipse.gef.editparts.AbstractConnectionEditPart)1 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)1 IAction (org.eclipse.jface.action.IAction)1 Control (org.eclipse.swt.widgets.Control)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IWorkbench (org.eclipse.ui.IWorkbench)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1