Search in sources :

Example 1 with DetailedLabelFigure

use of org.eclipse.gef.internal.ui.palette.editparts.DetailedLabelFigure in project tdi-studio-se by Talend.

the class TalendEntryEditPart method getSelectionRectangle.

protected static Rectangle getSelectionRectangle(int layoutMode, DetailedLabelFigure labelFigure) {
    Rectangle rect = Rectangle.SINGLETON;
    try {
        if (func_getSelectionRectangle == null) {
            func_getSelectionRectangle = ToolEntryEditPart.class.getDeclaredMethod("getSelectionRectangle", int.class, DetailedLabelFigure.class);
            func_getSelectionRectangle.setAccessible(true);
        }
        rect = (Rectangle) func_getSelectionRectangle.invoke(ToolEntryEditPart.class, layoutMode, labelFigure);
    } catch (Exception e) {
        CommonExceptionHandler.process(e);
    }
    return rect;
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) DetailedLabelFigure(org.eclipse.gef.internal.ui.palette.editparts.DetailedLabelFigure) ToolEntryEditPart(org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart)

Example 2 with DetailedLabelFigure

use of org.eclipse.gef.internal.ui.palette.editparts.DetailedLabelFigure 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

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