Search in sources :

Example 1 with IFoldableFigure

use of org.whole.lang.ui.figures.IFoldableFigure in project whole by wholeplatform.

the class AbstractPart method getFigure.

public IFigure getFigure() {
    if (figure == null) {
        super.getFigure();
        if (figure instanceof IFoldableFigure) {
            ActionListener toggleListener = null;
            for (Iterator<Toggle> iter = ((IFoldableFigure) figure).getFoldingToggles().iterator(); iter.hasNext(); ) {
                EntityToggle toggleFigure = (EntityToggle) iter.next();
                if (toggleListener == null)
                    toggleListener = createToggleListener();
                toggleFigure.addActionListener(toggleListener);
            }
            ;
        }
    }
    return figure;
}
Also used : ActionListener(org.eclipse.draw2d.ActionListener) Toggle(org.eclipse.draw2d.Toggle) EntityToggle(org.whole.lang.ui.figures.EntityToggle) EntityToggle(org.whole.lang.ui.figures.EntityToggle) IFoldableFigure(org.whole.lang.ui.figures.IFoldableFigure)

Example 2 with IFoldableFigure

use of org.whole.lang.ui.figures.IFoldableFigure in project whole by wholeplatform.

the class WholeExtendedExposeHelper method getFoldableAncestors.

private List<IFoldableFigure> getFoldableAncestors(IFigure figure) {
    IFigure hostFigure = hostPart.getFigure();
    List<IFoldableFigure> result = new ArrayList<IFoldableFigure>(1);
    IFigure foldableFigure = figure;
    do {
        // FIXME ? workaround
        if (foldableFigure == null)
            break;
        foldableFigure = foldableFigure.getParent();
        if (foldableFigure instanceof IFoldableFigure)
            result.add((IFoldableFigure) foldableFigure);
    } while (foldableFigure != hostFigure);
    return result;
}
Also used : ArrayList(java.util.ArrayList) IFoldableFigure(org.whole.lang.ui.figures.IFoldableFigure) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

IFoldableFigure (org.whole.lang.ui.figures.IFoldableFigure)2 ArrayList (java.util.ArrayList)1 ActionListener (org.eclipse.draw2d.ActionListener)1 IFigure (org.eclipse.draw2d.IFigure)1 Toggle (org.eclipse.draw2d.Toggle)1 EntityToggle (org.whole.lang.ui.figures.EntityToggle)1