Search in sources :

Example 6 with ActionEvent

use of org.eclipse.draw2d.ActionEvent in project yamcs-studio by yamcs.

the class RapButtonModel method fireActionPerformed.

/**
 * Notifies any ActionListeners on this ButtonModel that an action has been performed.
 *
 * @since 2.0
 */
@Override
protected void fireActionPerformed() {
    super.fireActionPerformed();
    Iterator<?> iter = eventListeners.getListeners(ActionListener.class);
    ActionEvent action = new ActionEvent(this);
    while (iter.hasNext()) ((ActionListener) iter.next()).actionPerformed(action);
}
Also used : ActionEvent(org.eclipse.draw2d.ActionEvent)

Example 7 with ActionEvent

use of org.eclipse.draw2d.ActionEvent in project yamcs-studio by yamcs.

the class ScrollbarFigure method setUpClickable.

/**
 * Sets the Clickable that represents the up arrow of the Scrollbar to <i>up</i>.
 *
 * @param up
 *            the up button
 * @since 2.0
 */
public void setUpClickable(Clickable up) {
    hookFocusListener(up);
    if (buttonUp != null) {
        remove(buttonUp);
    }
    buttonUp = up;
    if (up != null) {
        if (up instanceof Orientable)
            ((Orientable) up).setDirection(isHorizontal() ? Orientable.WEST : Orientable.NORTH);
        buttonUp.setFiringMethod(Clickable.REPEAT_FIRING);
        buttonUp.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                stepUp();
            }
        });
        add(buttonUp, ScrollBarLayout.UP_ARROW);
    }
}
Also used : ActionListener(org.eclipse.draw2d.ActionListener) Orientable(org.eclipse.draw2d.Orientable) ActionEvent(org.eclipse.draw2d.ActionEvent)

Example 8 with ActionEvent

use of org.eclipse.draw2d.ActionEvent in project yamcs-studio by yamcs.

the class ScrollbarFigure method setPageUp.

/**
 * Sets the pageup button to the passed Clickable. The pageup button is the rectangular figure between the down
 * arrow button and the ScrollBar's thumb figure.
 *
 * @param up
 *            the page up figure
 * @since 2.0
 */
public void setPageUp(Clickable up) {
    hookFocusListener(up);
    if (pageUp != null)
        remove(pageUp);
    pageUp = up;
    if (pageUp != null) {
        pageUp.setFiringMethod(Clickable.REPEAT_FIRING);
        pageUp.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent event) {
                pageUp();
            }
        });
        add(pageUp, ScrollBarLayout.PAGE_UP);
    }
}
Also used : ActionListener(org.eclipse.draw2d.ActionListener) ActionEvent(org.eclipse.draw2d.ActionEvent)

Example 9 with ActionEvent

use of org.eclipse.draw2d.ActionEvent in project yamcs-studio by yamcs.

the class ScrollbarFigure method setPageDown.

/**
 * Sets the pagedown button to the passed Clickable. The pagedown button is the figure between the down arrow button
 * and the ScrollBar's thumb figure.
 *
 * @param down
 *            the page down figure
 * @since 2.0
 */
public void setPageDown(Clickable down) {
    hookFocusListener(down);
    if (pageDown != null)
        remove(pageDown);
    pageDown = down;
    if (pageDown != null) {
        pageDown.setFiringMethod(Clickable.REPEAT_FIRING);
        pageDown.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent event) {
                pageDown();
            }
        });
        add(down, ScrollBarLayout.PAGE_DOWN);
    }
}
Also used : ActionListener(org.eclipse.draw2d.ActionListener) ActionEvent(org.eclipse.draw2d.ActionEvent)

Example 10 with ActionEvent

use of org.eclipse.draw2d.ActionEvent in project whole by wholeplatform.

the class ContentPaneFigure method createFoldingToggle.

public Toggle createFoldingToggle(Toggle toggle, final int paneIndexOrTag, int... paneIndexes) {
    toggle.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent event) {
            new AnimableRunnable() {

                public void doRun() {
                    toggleVisibility(paneIndexOrTag);
                }
            }.syncExec();
        }
    });
    createActionableFoldingToggle(toggle, paneIndexes);
    bindFoldingToggle(foldingToggles.size() - 1, paneIndexOrTag);
    return toggle;
}
Also used : ActionListener(org.eclipse.draw2d.ActionListener) ActionEvent(org.eclipse.draw2d.ActionEvent) AnimableRunnable(org.whole.lang.ui.util.AnimableRunnable)

Aggregations

ActionEvent (org.eclipse.draw2d.ActionEvent)13 ActionListener (org.eclipse.draw2d.ActionListener)12 Clickable (org.eclipse.draw2d.Clickable)3 Orientable (org.eclipse.draw2d.Orientable)2 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)2 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Figure (org.eclipse.draw2d.Figure)1 IFigure (org.eclipse.draw2d.IFigure)1 ImageFigure (org.eclipse.draw2d.ImageFigure)1 RoundedRectangle (org.eclipse.draw2d.RoundedRectangle)1 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1 AccessibleEditPart (org.eclipse.gef.AccessibleEditPart)1 EditPart (org.eclipse.gef.EditPart)1 EditPartViewer (org.eclipse.gef.EditPartViewer)1 AbstractEditPart (org.eclipse.gef.editparts.AbstractEditPart)1 AbstractGraphicalEditPart (org.eclipse.gef.editparts.AbstractGraphicalEditPart)1