use of org.eclipse.draw2d.FigureCanvas in project tdi-studio-se by Talend.
the class AbstractTalendEditor method configurationSubJob.
protected void configurationSubJob(GraphicalViewer viewer) {
if (getProcess() != null) {
if (getProcess().isSubjobEnabled()) {
// toggle subjobs action
IAction toggleSubjobsAction = ToggleSubjobsAction.getDefault();
getActionRegistry().registerAction(toggleSubjobsAction);
for (Iterator iterator = getSelectionActions().iterator(); iterator.hasNext(); ) {
String actionID = (String) iterator.next();
IAction action = getActionRegistry().getAction(actionID);
setAction(actionID, action);
}
}
int minx = getMinX();
int miny = getMinY();
if (viewer != null && viewer.getControl() instanceof FigureCanvas) {
if (minx < 0) {
((FigureCanvas) viewer.getControl()).getViewport().getHorizontalRangeModel().setMinimum(minx);
((FigureCanvas) viewer.getControl()).scrollToX(minx);
}
if (miny < 0) {
((FigureCanvas) viewer.getControl()).getViewport().getVerticalRangeModel().setMinimum(miny);
((FigureCanvas) viewer.getControl()).scrollToY(miny);
}
}
}
}
use of org.eclipse.draw2d.FigureCanvas in project tdi-studio-se by Talend.
the class TalendPaletteViewerProvider method createPaletteViewer.
@Override
public PaletteViewer createPaletteViewer(Composite parent) {
// removed by 10304
// if (SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_MAC) {
// // PTDO need check it later and fix the bug on MacOS.
// return super.createPaletteViewer(parent);
// }
talendPaletteViewer = new TalendPaletteViewer(this.getEditDomain(), cssStyleSetting);
FigureCanvas canvas = new TalendFigureCanvas(parent, talendPaletteViewer.getLightweightSys(), talendPaletteViewer);
talendPaletteViewer.setFigureCanvas(canvas);
configurePaletteViewer(talendPaletteViewer);
hookPaletteViewer(talendPaletteViewer);
return talendPaletteViewer;
}
Aggregations