Search in sources :

Example 1 with TalendDrawerEditPart

use of org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart in project tdi-studio-se by Talend.

the class AbstractTalendEditor method collapsePalette.

/**
     * DOC hcw Comment method "collapsePalette".
     * 
     * @param children
     */
private void collapsePalette(List children) {
    for (Object object : children) {
        if (object instanceof TalendDrawerEditPart) {
            TalendDrawerEditPart part = (TalendDrawerEditPart) object;
            part.setExpanded(false);
            collapsePalette(part.getChildren());
        } else if (object instanceof EditPart) {
            collapsePalette(((EditPart) object).getChildren());
        }
    }
}
Also used : EditPart(org.eclipse.gef.EditPart) NodeTreeEditPart(org.talend.designer.core.ui.editor.outline.NodeTreeEditPart) AbstractEditPart(org.eclipse.gef.editparts.AbstractEditPart) RootEditPart(org.eclipse.gef.RootEditPart) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) TalendDrawerEditPart(org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart) ConnLabelEditPart(org.talend.designer.core.ui.editor.connections.ConnLabelEditPart) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) EventObject(java.util.EventObject) TalendDrawerEditPart(org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart)

Example 2 with TalendDrawerEditPart

use of org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart in project tdi-studio-se by Talend.

the class AbstractTalendEditor method expandPaletteDrawer.

/**
     * DOC hcw Comment method "expandPaletteDrawer".
     * 
     * @param paletteViewer
     * @param paletteEntry
     */
private void expandPaletteDrawer(PaletteViewer paletteViewer, ToolEntry paletteEntry) {
    List<TalendDrawerEditPart> parts = new ArrayList<TalendDrawerEditPart>();
    PaletteContainer parent = paletteEntry.getParent();
    while (parent != null) {
        if (parent instanceof TalendPaletteDrawer) {
            Object editpart = paletteViewer.getEditPartRegistry().get(parent);
            if (editpart instanceof TalendDrawerEditPart) {
                parts.add((TalendDrawerEditPart) editpart);
            }
        }
        parent = parent.getParent();
    }
    for (int i = parts.size() - 1; i >= 0; i--) {
        parts.get(i).setExpanded(true);
    }
}
Also used : TalendPaletteDrawer(org.talend.designer.core.ui.editor.palette.TalendPaletteDrawer) ArrayList(java.util.ArrayList) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) EventObject(java.util.EventObject) TalendDrawerEditPart(org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart) PaletteContainer(org.eclipse.gef.palette.PaletteContainer) Point(org.eclipse.draw2d.geometry.Point)

Aggregations

EventObject (java.util.EventObject)2 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 TalendDrawerEditPart (org.talend.designer.core.ui.editor.palette.TalendDrawerEditPart)2 ArrayList (java.util.ArrayList)1 Point (org.eclipse.draw2d.geometry.Point)1 EditPart (org.eclipse.gef.EditPart)1 RootEditPart (org.eclipse.gef.RootEditPart)1 AbstractEditPart (org.eclipse.gef.editparts.AbstractEditPart)1 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)1 PaletteContainer (org.eclipse.gef.palette.PaletteContainer)1 ConnLabelEditPart (org.talend.designer.core.ui.editor.connections.ConnLabelEditPart)1 NodeTreeEditPart (org.talend.designer.core.ui.editor.outline.NodeTreeEditPart)1 TalendPaletteDrawer (org.talend.designer.core.ui.editor.palette.TalendPaletteDrawer)1