public IInformationControlCreator getInformationControlCreator() { int orientation; IEditorPart editor= getJavaEditor(); if (editor instanceof IWorkbenchPartOrientation) orientation= ((IWorkbenchPartOrientation)editor).getOrientation(); else orientation= SWT.LEFT_TO_RIGHT; return new TemplateInformationControlCreator(orientation); }
public static IInformationControlCreator createTemplateInformationControlCreator() { int orientation = SWT.LEFT_TO_RIGHT; IEditorPart editor = WorkbenchUtils.getActiveEditor(); if(editor instanceof IWorkbenchPartOrientation) { orientation = ((IWorkbenchPartOrientation) editor).getOrientation(); orientation = orientation == SWT.NONE ? SWT.LEFT_TO_RIGHT : orientation; } return new TemplateInformationControlCreator(orientation); }
/** * Get the orientation of the editor. * * @param editor * @return int the orientation flag * @see SWT#RIGHT_TO_LEFT * @see SWT#LEFT_TO_RIGHT * @see SWT#NONE */ private int getOrientation(IEditorPart editor) { if (editor instanceof IWorkbenchPartOrientation) { return ((IWorkbenchPartOrientation) editor).getOrientation(); } return getOrientation(); }