Search in sources :

Example 1 with Clickable

use of org.eclipse.draw2d.Clickable in project tdi-studio-se by Talend.

the class TalendEntryEditPart method createFigure.

@Override
public IFigure createFigure() {
    Field customLabelField;
    try {
        talendCustomLabel = new DetailedLabelFigure();
        //$NON-NLS-1$
        customLabelField = ToolEntryEditPart.class.getDeclaredField("customLabel");
        customLabelField.setAccessible(true);
        customLabelField.set(this, talendCustomLabel);
    } catch (Exception e) {
        CommonExceptionHandler.process(e);
    }
    Clickable button = new ToolEntryToggle(talendCustomLabel);
    button.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent event) {
            getPaletteViewer().setActiveTool(getToolEntry());
        }
    });
    return button;
}
Also used : Field(java.lang.reflect.Field) ActionListener(org.eclipse.draw2d.ActionListener) Clickable(org.eclipse.draw2d.Clickable) ActionEvent(org.eclipse.draw2d.ActionEvent) DetailedLabelFigure(org.eclipse.gef.internal.ui.palette.editparts.DetailedLabelFigure) ToolEntryEditPart(org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart)

Aggregations

Field (java.lang.reflect.Field)1 ActionEvent (org.eclipse.draw2d.ActionEvent)1 ActionListener (org.eclipse.draw2d.ActionListener)1 Clickable (org.eclipse.draw2d.Clickable)1 DetailedLabelFigure (org.eclipse.gef.internal.ui.palette.editparts.DetailedLabelFigure)1 ToolEntryEditPart (org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart)1