public MasterPageSelectionAction( MasterPageHandle handle ) { super( DEUtil.getDisplayLabel( handle ), IAction.AS_RADIO_BUTTON ); this.handle = handle; boolean checked = false; FormEditor formEditor = UIUtil.getActiveReportEditor( ); if ( formEditor != null ) { if ( ReportMasterPageEditorFormPage.ID.equals( formEditor.getActivePageInstance( ) .getId( ) ) ) { checked = ( ( (ReportMasterPageEditorFormPage) ( formEditor.getActivePageInstance( ) ) ).getGraphicalViewer( ) .getContents( ) .getModel( ) == handle ); } } setChecked( checked ); }
public void setSelection( ISelection selection ) { IEditorPart activeEditor = ( (FormEditor) getMultiPageEditor( ) ).getActivePageInstance( ); if ( activeEditor != null ) { ISelectionProvider selectionProvider = activeEditor.getSite( ) .getSelectionProvider( ); if ( selectionProvider != null ) selectionProvider.setSelection( selection ); } else { this.globalSelection = selection; fireSelectionChanged( new SelectionChangedEvent( this, globalSelection ) ); } }
public void run( IAction action ) { ModuleHandle handle = null; if (handle == null ) { FormEditor editor = UIUtil.getActiveReportEditor( false ); if (editor instanceof MultiPageReportEditor) { handle = ((MultiPageReportEditor)editor).getModel( ); } } if (handle != null) { String fileName = handle.getFileName( ); ILaunchConfiguration config = ScriptLaunchShortcut.findLaunchConfiguration( fileName, ScriptLaunchShortcut.getConfigurationType( ) ); if (config != null) { DebugUITools.launch(config, "debug");//$NON-NLS-1$ } } }
protected IEditorPart open(Object object, IEditorInput input, String editorId, String pageId) throws Exception { IEditorPart editor = openEditor(input, editorId, true); if (pageId != null && editor instanceof FormEditor) { ((FormEditor) editor).setActivePage(pageId); } return editor; }
/** * Constructs the page * * @param editor */ public AdvancedModelPage(FormEditor editor) { super(editor, AdvancedModelPage.ID, "Advanced Options"); this.helpId = IHelpConstants.ADVANCED_MODEL_PAGE; this.imagePath = "icons/full/choice_sc_obj.gif"; }
/** * Constructor for the page * @param editor */ public ResultPage(FormEditor editor) { super(editor, ID, "Model Checking Results"); this.helpId = IHelpConstants.RESULT_MODEL_PAGE; this.imagePath = "icons/full/choice_sc_obj.gif"; }
public void init( IEditorSite site, IEditorInput input ) throws PartInitException { super.init( site, input ); initialize( (FormEditor) ( (MultiPageEditorSite) site ).getMultiPageEditor( ) ); // Initializes command stack // WrapperCommandStack stack = (WrapperCommandStack) getCommandStack( ); // if ( stack != null ) // { // stack.addCommandStackListener( getCommandStackListener( ) ); // } }
protected void preview( String format, boolean allowPage ) { if ( !prePreview( ) ) { return; } FormEditor editor = UIUtil.getActiveReportEditor( false ); ModuleHandle model = null; if ( editor instanceof MultiPageReportEditor ) { model = ( (MultiPageReportEditor) editor ).getModel( ); } if ( !UIUtil.canPreviewWithErrors( model ) ) return; if ( editor != null ) { IFormPage activePageInstance=editor.getActivePageInstance(); if ( model.needsSave( ) ||(activePageInstance!=null && activePageInstance.isDirty()))//Do save when current active page is dirty. { editor.doSave( null ); } } Map<String, Object> options = new HashMap<String, Object>( ); options.put( WebViewer.FORMAT_KEY, format ); options.put( WebViewer.ALLOW_PAGE_KEY, Boolean.valueOf( allowPage ) ); options.put( WebViewer.RESOURCE_FOLDER_KEY, ReportPlugin.getDefault( ) .getResourceFolder( ) ); if (hasParameters(model)) { options.put(WebViewer.SHOW_PARAMETER_PAGE_KEY, "true"); } WebViewer.display( model.getFileName( ), options ); }
protected void preview( EmitterInfo ei, IEmitterDescriptor descriptor ) { if ( !prePreview( ) ) { return; } FormEditor editor = UIUtil.getActiveReportEditor( false ); ModuleHandle model = null; if ( editor instanceof MultiPageReportEditor ) { model = ( (MultiPageReportEditor) editor ).getModel( ); } if ( !UIUtil.canPreviewWithErrors( model ) ) return; if ( editor != null ) { if ( model.needsSave( ) ) { editor.doSave( null ); } } Map<String, Object> options = new HashMap<String, Object>( ); options.put( WebViewer.EMITTER_ID_KEY, ei.getID( ) ); options.put( WebViewer.FORMAT_KEY, ei.getFormat( ) ); options.put( WebViewer.ALLOW_PAGE_KEY, Boolean.valueOf( false ) ); options.put( WebViewer.RESOURCE_FOLDER_KEY, ReportPlugin.getDefault( ) .getResourceFolder( ) ); WebViewer.display( model.getFileName( ), options ); }
/** * Return the project folder if current edited report file is in eclipse * project, else return the report file's folder. * * This method is used for set IModuleOption.RESOURCE_FOLDER_KEY property * when open report. * * @return */ public static String getProjectFolder( ) { FormEditor editor = getActiveReportEditor( ); if ( editor != null ) { IEditorInput input = editor.getEditorInput( ); if ( input != null ) { return getProjectFolder( input ); } } return null; }
public static void refreshCurrentEditorMarkers( ) { FormEditor editor = UIUtil.getActiveReportEditor( ); if ( editor instanceof AbstractMultiPageEditor ) { try { ( (AbstractMultiPageEditor) editor ).refreshMarkers( editor.getEditorInput( ) ); } catch ( CoreException e ) { } } }
public void update( ) { FormEditor editor = UIUtil.getActiveReportEditor( ); setEnabled( editor != null ); //Add judge the id is null,see https://bugs.eclipse.org/bugs/show_bug.cgi?id=305851 //It is a strange because the BIRD editor is not null.Maybe conflict with others product?Need deeply research. if ( editor != null && editor.getActivePageInstance( )!= null && editor.getActivePageInstance( ).getId( ) != null) { setChecked( editor.getActivePageInstance( ) .getId( ) .equals( pageId ) ); } }
public ISelection getSelection( ) { IEditorPart activeEditor = ( (FormEditor) getMultiPageEditor( ) ).getActivePageInstance( ); // IEditorPart activeEditor = getActivePageInstance( ); if ( activeEditor != null ) { ISelectionProvider selectionProvider = activeEditor.getSite( ) .getSelectionProvider( ); if ( selectionProvider != null ) return selectionProvider.getSelection( ); } return globalSelection; }
/** * Returns the current active report editor in current active page or * current active workbench. * * @return */ public static FormEditor getActiveReportEditor( ) { IWorkbenchWindow window = PlatformUI.getWorkbench( ) .getActiveWorkbenchWindow( ); if ( window != null ) { IWorkbenchPage pg = window.getActivePage( ); if ( pg != null ) { IEditorPart editor = pg.getActiveEditor( ); if ( editor != null ) { if ( editor instanceof ReportEditorProxy ) { IEditorPart part = ( (ReportEditorProxy) editor ).getEditorPart( ); if ( part instanceof FormEditor ) { return (FormEditor) part; } } else if ( editor instanceof FormEditor ) { return (FormEditor) editor; } } } } return null; }
@Override public void contributeToToolBar(IToolBarManager manager) { manager.add(Actions.create("Run", Icon.RUN.descriptor(), () -> { FormEditor editor = Editors.getActive(); if (!(editor instanceof IScriptEditor)) return; IScriptEditor scriptEditor = (IScriptEditor) editor; scriptEditor.evalContent(); })); }
public TotalImpactResultPage(FormEditor editor, ContributionResultProvider<?> result, DQResult dqResult, CalculationSetup setup, ImpactFactorProvider impactFactors) { super(editor, "ImpactTreePage", M.ImpactAnalysis); this.result = result; this.setup = setup; this.dqResult = dqResult; this.impactFactors = impactFactors; }
public InventoryPage(FormEditor editor, ContributionResultProvider<?> result, DQResult dqResult, CalculationSetup setup) { super(editor, "InventoryPage", M.InventoryResults); this.result = result; this.setup = setup; this.dqResult = dqResult; }
public ContributionTreePage(FormEditor editor, FullResultProvider result, CalculationSetup setup) { super(editor, "analysis.ContributionTreePage", M.ContributionTree); this.result = result; this.setup = setup; for (ProcessDescriptor desc : result.getProcessDescriptors()) processDescriptors.put(desc.getId(), desc); Iterator<FlowDescriptor> it = result.getFlowDescriptors().iterator(); if (it.hasNext()) selection = it.next(); }
public ProcessResultPage(FormEditor editor, FullResultProvider result, CalculationSetup setup) { super(editor, ProcessResultPage.class.getName(), M.ProcessResults); this.result = result; this.setup = setup; for (ProcessDescriptor desc : result.getProcessDescriptors()) processDescriptors.put(desc.getId(), desc); this.flowResult = new ResultProvider(result); this.impactResult = new ResultProvider(result); }
public DeploymentPage(FormEditor editor,GraphicalViewer graphicalViewer,String title) { super(editor,DeploymentPage.class.getName(), title); this.graphicalViewer=graphicalViewer; }
public OverviewPage(FormEditor editor, String id, String title, Node solution) { super(editor, id, title); this.solution = solution; }
public DescriptionPage(FormEditor editor, String id, String title, Node solution, IEditorSite site) { super(editor, id, title); this.solution = solution; this.site = site; }
public ExecutedClassesPage(FormEditor parent, ExecutionDataContent content) { super(parent, "classes", ExecutionDataEditorExecutedClassesPage_title); //$NON-NLS-1$ this.content = content; this.refreshJob = new RefreshJob(); }
public SessionDataPage(FormEditor parent, ExecutionDataContent content) { super(parent, "sessions", ExecutionDataEditorSessionsPage_title); //$NON-NLS-1$ this.content = content; this.dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); }
public PDFViewingPage(FormEditor editor, String id, String title) { super(editor, id, title); }
/** * constructs the main model page * @param editor */ public MainModelPage(FormEditor editor) { super(editor, MainModelPage.ID, MainModelPage.TITLE); this.helpId = IHelpConstants.MAIN_MODEL_PAGE; this.imagePath = "icons/full/choice_sc_obj.gif"; // available system memory final long phySysMem = TLCRuntime.getInstance().getAbsolutePhysicalSystemMemory(1.0d); // 0.) Create LinearInterpolator with two additional points 0,0 and 1,0 which int s = 0; double[] x = new double[6]; double[] y = new double[x.length]; // base point y[s] = 0d; x[s++] = 0d; // 1.) Minumum TLC requirements // Use hard-coded minfpmemsize value * 4 * 10 regardless of how big the // model is. *4 because .25 mem is used for FPs double lowerLimit = ( (TLCRuntime.MinFpMemSize / 1024 / 1024 * 4d) / phySysMem) / 2; x[s] = lowerLimit; y[s++] = 0d; // a.) // Current bloat in software is assumed to grow according to Moore's law => // 2^((Year-1993)/ 2)+2) // (1993 as base results from a statistic of windows OS memory requirements) final int currentYear = Calendar.getInstance().get(Calendar.YEAR); double estimateSoftwareBloatInMBytes = Math.pow(2, ((currentYear - 1993) / 3) + 3.5); // 2.) Optimal range x[s] = lowerLimit * 2d; y[s++] = 1.0d; x[s] = 1.0d - (estimateSoftwareBloatInMBytes / phySysMem); y[s++] = 1.0d; // 3.) Calculate OS reserve double upperLimit = 1.0d - (estimateSoftwareBloatInMBytes / phySysMem) / 2; x[s] = upperLimit; y[s++] = 0d; // base point x[s] = 1d; y[s] = 0d; linearInterpolator = new Interpolator(x, y); }
public AutomationPage(FormEditor editor) { super(editor, "hmm.automation.AutomationPage", editor.getEditorInput().getName()); block = new AutomationBlock(this); }
public EssentialsPage(FormEditor editor) { super(editor, "essentials", "Overview"); formToolkit = editor.getToolkit(); }
public AbstactConfigEditorPage(FormEditor editor, String id, String title) { super(editor, id, title); }
public PropertiesPage(FormEditor editor) { super(editor, "properties", "Platform Properties"); formToolkit = editor.getToolkit(); }
public IconsPage(FormEditor editor) { super(editor, "icons", "Icons && Splash Screen"); formToolkit = editor.getToolkit(); }
/** * @param editor FormEditor */ public OverviewFormPage(FormEditor editor) { super(editor, "overview", "Overview"); }
public void initialize( FormEditor editor ) { this.editor = editor; }
public FormEditor getEditor( ) { return editor; }
public void initialize( FormEditor editor ) { this.editor = editor; setRangeIndicator( new Annotation( ) { } ); }