org.eclipse.ui.forms.editor.FormEditor Java Examples
The following examples show how to use
org.eclipse.ui.forms.editor.FormEditor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DebugScriptAction.java From birt with Eclipse Public License 1.0 | 6 votes |
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$ } } }
Example #2
Source File: DefaultIEMFSectionPageProvider.java From ice with Eclipse Public License 1.0 | 6 votes |
public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); EMFComponent emfComponent = null; EMFSectionPage emfPage = null; if (components.size() > 0) { for (Component comp : components) { emfComponent = (EMFComponent) comp; if (emfComponent != null) { // Make the EMFSectionPage emfPage = new EMFSectionPage(formEditor, emfComponent.getName(), emfComponent.getName()); // Set the EMFComponent emfPage.setEMFComponent(emfComponent); pages.add(emfPage); } } } return pages; }
Example #3
Source File: MasterPageSelectionAction.java From birt with Eclipse Public License 1.0 | 6 votes |
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 ); }
Example #4
Source File: DefaultGeometryPageProvider.java From ice with Eclipse Public License 1.0 | 6 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); // Get the GeometryComponent and create the GeometryPage. if (!(components.isEmpty())) { GeometryComponent geometryComponent = (GeometryComponent) (components .get(0)); if (geometryComponent != null) { // Make the GeometryPage ICEGeometryPage geometryPage = new ICEGeometryPage(formEditor, "GPid", geometryComponent.getName()); // Set the GeometryComponent geometryPage.setGeometry(geometryComponent); pages.add(geometryPage); } } return pages; }
Example #5
Source File: DefaultMeshPageProvider.java From ice with Eclipse Public License 1.0 | 6 votes |
public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); MeshComponent meshComponent = new MeshComponent(); // Get the GeometryComponent and create the GeometryPage. if (!(components.isEmpty())) { meshComponent = (MeshComponent) (components.get(0)); if (meshComponent != null) { ICEMeshPage meshPage; // Make the MeshPage meshPage = new ICEMeshPage(formEditor, "MeshPid", meshComponent.getName()); // Set the MeshComponent meshPage.setMeshComponent(meshComponent); pages.add(meshPage); } } return pages; }
Example #6
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 6 votes |
@Override public ArrayList<IFormPage> getGeometryComponentPages(FormEditor editor, ArrayList<Component> components) { // List for the pages ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); IPageProvider provider = null; String compContext = components.get(0).getContext(); // Use the default provider if that is what is requested if ("ice-default".equals(compContext)) { provider = new DefaultGeometryPageProvider(); } else { // Otherwise see if something registering the context has been // provided in the e4 context. provider = (IPageProvider) context.get(compContext); } // Grab the pages pages = provider.getPages(editor, components); return pages; }
Example #7
Source File: ICESectionPage.java From ice with Eclipse Public License 1.0 | 6 votes |
/** * <p> * The Constructor * </p> * * @param editor * <p> * The FormEditor for which the Page should be constructed. * </p> * @param id * <p> * The id of the page. * </p> * @param title * <p> * The title of the page. * </p> */ public ICESectionPage(FormEditor editor, String id, String title) { // Call the super constructor super(editor, id, title); // Set the FormEditor if it is not null and throw an exception // otherwise. if (editor != null && editor instanceof ICEFormEditor) { this.editor = (ICEFormEditor) editor; } else { throw new RuntimeException("Editor in ICEFormSectionPage " + " constructor cannot be null."); } // Setup the list for Components dataComponents = new ArrayList<DataComponent>(); tableComponents = new ArrayList<TableComponent>(); matrixComponents = new ArrayList<MatrixComponent>(); return; }
Example #8
Source File: DefaultListPageProvider.java From ice with Eclipse Public License 1.0 | 6 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { // Get the lists from the component map ArrayList<IFormPage> pages = new ArrayList<IFormPage>( components.size()); // If there are some lists, render sections for them for (int i = 0; i < components.size(); i++) { ListComponent<?> list = (ListComponent<?>) components.get(i); // Make sure the list isn't null since that value can be put in // a collection if (list != null) { // Create a new page for the list ListComponentSectionPage page = new ListComponentSectionPage( formEditor, list.getName(), list.getName()); page.setList(list); // Add the page to the return list pages.add(page); } } return pages; }
Example #9
Source File: MultiPageReportEditor.java From birt with Eclipse Public License 1.0 | 6 votes |
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 ) ); } }
Example #10
Source File: ICEResourcePage.java From ice with Eclipse Public License 1.0 | 6 votes |
/** * The default constructor. * * @param editor * The FormEditor for which the Page should be constructed. This * should be an {@link ICEFormEditor}. * @param id * The id of the page. * @param title * The title of the page. */ public ICEResourcePage(FormEditor editor, String id, String title) { // Call the super constructor super(editor, id, title); // Set the ICEFormEditor if (!(editor instanceof ICEFormEditor)) { logger.info("ICEResourcePage Message: Invalid FormEditor."); } // Create the list of text file extensions String[] extensions = { "txt", "sh", "i" }; textFileExtensions = new ArrayList<String>(Arrays.asList(extensions)); ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); return; }
Example #11
Source File: ICEMeshPage.java From ice with Eclipse Public License 1.0 | 6 votes |
/** * The constructor * * @param editor * The FormEditor for which the page should be constructed. * @param id * The id of the page. * @param title * The title of the page. */ public ICEMeshPage(FormEditor editor, String id, String title) { // Just call ICEFormPage's constructor super(editor, id, title); // Create the list of actions (these go in the ToolBar and the // rightClickMenu). actions = new ArrayList<ActionTree>(); // Initialize the Menu- and ToolBarManagers. actionToolBarManager = new ToolBarManager(); actionMenuManager = new MenuManager(); // Initialize the collection of selection listeners listeners = new ListenerList(); return; }
Example #12
Source File: DefaultErrorPageProvider.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); pages.add(new ErrorMessageFormPage(formEditor, "Error Page", "Error Page")); return pages; }
Example #13
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getMeshComponentPages(FormEditor editor, ArrayList<Component> components) { // List for the pages ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); try { // Create the provider and get the pages from it ArrayList<IMeshPageProvider> MeshComponentPages = IMeshPageProvider .getProviders(); if (MeshComponentPages != null && MeshComponentPages.size() > 0) { // Use the default error page provider String providerNameToUse = DefaultErrorPageProvider.PROVIDER_NAME; // Do a linear search to find the correct provider for (IMeshPageProvider currentProvider : MeshComponentPages) { if (providerNameToUse.equals(currentProvider.getName())) { pages = currentProvider.getPages(editor, components); break; } } } else { logger.error("No MeshComponentPages registered"); } } catch (CoreException e) { logger.error("Unable to get MeshComponentPages", e); } return pages; }
Example #14
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getMasterDetailsPages(FormEditor editor, ArrayList<Component> components) { // Array for storing the pages ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); try { // get all of the registered master details page providers ArrayList<IMasterDetailsPageProvider> masterDetailsPageProviders = IMasterDetailsPageProvider .getProviders(); if (masterDetailsPageProviders != null && masterDetailsPageProviders.size() > 0) { // Use the default master details page provider String providerNameToUse = DefaultBasicComponentPageProvider.PROVIDER_NAME; // Do a linear search to find the correct provider for (IMasterDetailsPageProvider currentProvider : masterDetailsPageProviders) { if (providerNameToUse.equals(currentProvider.getName())) { pages = currentProvider.getPages(editor, components); break; } } } else { logger.error("No MasterDetailsPageProviders registered"); } } catch (CoreException e) { logger.error("Unable to get MasterDetailsPageProviders", e); } return pages; }
Example #15
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getIEMFSectionComponentPages(FormEditor editor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); try { ArrayList<IEMFSectionPageProvider> EMFSectionComponentPages = IEMFSectionPageProvider .getProviders(); if (EMFSectionComponentPages != null && EMFSectionComponentPages.size() > 0) { // Use the default error page provider String providerNameToUse = DefaultErrorPageProvider.PROVIDER_NAME; // Do a linear search to find the correct provider for (IEMFSectionPageProvider currentProvider : EMFSectionComponentPages) { if (providerNameToUse.equals(currentProvider.getName())) { pages = currentProvider.getPages(editor, components); break; } } } else { logger.error("No EFSectionComponentPages registered"); } } catch (CoreException e) { logger.error("Unable to get IEFSectionComponentPages", e); } return pages; }
Example #16
Source File: DebugStartupClass.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * 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; }
Example #17
Source File: ResultPage.java From tlaplus with MIT License | 5 votes |
/** * Constructor for the page * @param editor */ public ResultPage(final FormEditor editor) { super(editor, ID, "Model Checking Results", "icons/full/results_page_" + IMAGE_TEMPLATE_TOKEN + ".png"); helpId = IHelpConstants.RESULT_MODEL_PAGE; notificationService = NotificationsUi.getService(); errorPaneViewState = new ErrorPaneViewState(); markedErrorMessages = new ArrayList<>(); }
Example #18
Source File: MainModelPage.java From tlaplus with MIT License | 5 votes |
/** * constructs the main model page * * @param editor */ public MainModelPage(final FormEditor editor) { super(editor, MainModelPage.ID, MainModelPage.TITLE, "icons/full/model_options_" + IMAGE_TEMPLATE_TOKEN + ".png"); helpId = IHelpConstants.MAIN_MODEL_PAGE; currentProfileIsAdHoc = new AtomicBoolean(false); workerValueCanBeModified = new AtomicBoolean(true); heapPercentageCanBeModified = new AtomicBoolean(true); }
Example #19
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getBasicComponentPages(FormEditor editor, ArrayList<Component> components) { // Array for storing the pages ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); try { // get all of the registered basic component page providers ArrayList<IBasicComponentPageProvider> basicComponentProviders = IBasicComponentPageProvider .getProviders(); if (basicComponentProviders != null && basicComponentProviders.size() > 0) { // Use the default basic component page provider String providerNameToUse = DefaultBasicComponentPageProvider.PROVIDER_NAME; // Do a linear search to find the correct provider for (IBasicComponentPageProvider currentProvider : basicComponentProviders) { if (providerNameToUse.equals(currentProvider.getName())) { pages = currentProvider.getPages(editor, components); break; } } } else { logger.error("No BasicComponentPageProviders registered"); } } catch (CoreException e) { logger.error("Unable to get BasicComponentPageProviders", e); } return pages; }
Example #20
Source File: DefaultPageFactory.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public IFormPage getErrorPage(FormEditor editor) { // Array for storing the pages ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); try { // get all of the registered ListPageProviders ArrayList<IErrorPageProvider> errorPageProviders = IErrorPageProvider .getProviders(); if (errorPageProviders != null && errorPageProviders.size() > 0) { // Use the default error page provider String providerNameToUse = DefaultErrorPageProvider.PROVIDER_NAME; // Do a linear search to find the correct provider for (IErrorPageProvider currentProvider : errorPageProviders) { if (providerNameToUse.equals(currentProvider.getName())) { // The Error Page does not use any components, so // passing null as the second argument is OK. In // general, a list of components should be passed here. pages = currentProvider.getPages(editor, null); break; } } } else { logger.error("No ErrorPageProviders registered"); } } catch (CoreException e) { logger.error("Unable to get ErrorPageProviders", e); } // There should only be one page since this is an error page, so just // get the first element. return pages.get(0); }
Example #21
Source File: DefaultResourcePageProvider.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { // Local Declarations ResourceComponent resourceComponent = null; ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); ICEResourcePage resourceComponentPage = null; // Get the ResourceComponent and create the ICEOutput page. There // should // only be one output page. if (!(components.isEmpty())) { resourceComponent = (ResourceComponent) (components.get(0)); if (resourceComponent != null) { // Make the page resourceComponentPage = new ICEResourcePage(formEditor, resourceComponent.getName(), resourceComponent.getName()); // Set the ResourceComponent resourceComponentPage.setResourceComponent(resourceComponent); } } // Add and return the page pages.add(resourceComponentPage); return pages; }
Example #22
Source File: DefaultMasterDetailsPageProvider.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); ArrayList<ICEFormPage> masterDetailsPages = new ArrayList<ICEFormPage>(); MasterDetailsComponent masterDetailsComponent = null; // Get the MasterDetailsComponent and create the MasterDetails page. if (!components.isEmpty()) { masterDetailsComponent = (MasterDetailsComponent) (components .get(0)); if (masterDetailsComponent != null) { // Get the name String name = masterDetailsComponent.getName(); // Make the page ICEMasterDetailsPage iCEMasterDetailsPage = new ICEMasterDetailsPage( formEditor, "MDPid", name); // Set the MasterDetailsComponent iCEMasterDetailsPage .setMasterDetailsComponent(masterDetailsComponent); masterDetailsPages.add(iCEMasterDetailsPage); } } pages.addAll(masterDetailsPages); return pages; }
Example #23
Source File: ProcessResultPage.java From olca-app with Mozilla Public License 2.0 | 5 votes |
public ProcessResultPage(FormEditor editor, FullResult result, CalculationSetup setup) { super(editor, ProcessResultPage.class.getName(), M.ProcessResults); this.result = result; this.setup = setup; for (CategorizedDescriptor desc : result.getProcesses()) { if (desc instanceof ProcessDescriptor) { processes.put(desc.id, (ProcessDescriptor) desc); } } this.flowResult = new ResultProvider(result); this.impactResult = new ResultProvider(result); }
Example #24
Source File: PreviewSupport.java From birt with Eclipse Public License 1.0 | 5 votes |
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 ); }
Example #25
Source File: PreviewSupport.java From birt with Eclipse Public License 1.0 | 5 votes |
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 ); }
Example #26
Source File: DemoGeometryPageProvider.java From ice with Eclipse Public License 1.0 | 5 votes |
@Override public ArrayList<IFormPage> getPages(FormEditor formEditor, ArrayList<Component> components) { ArrayList<IFormPage> pages = new ArrayList<IFormPage>(); // Get the GeometryComponent and create the GeometryPage. if (!(components.isEmpty())) { GeometryComponent geometryComponent = (GeometryComponent) (components .get(0)); if (geometryComponent != null) { // Make the GeometryPage DemoGeometryPage geometryPage = new DemoGeometryPage(formEditor, "GPid", geometryComponent.getName()); // No need to set the geometry component for the demo, but // something like would be necessary in a real application. // geometryPage.setGeometry(geometryComponent); // Add the page pages.add(geometryPage); } } return pages; }
Example #27
Source File: UIUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * 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; }
Example #28
Source File: UIUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
public static void refreshCurrentEditorMarkers( ) { FormEditor editor = UIUtil.getActiveReportEditor( ); if ( editor instanceof AbstractMultiPageEditor ) { try { ( (AbstractMultiPageEditor) editor ).refreshMarkers( editor.getEditorInput( ) ); } catch ( CoreException e ) { } } }
Example #29
Source File: PageSetAction.java From birt with Eclipse Public License 1.0 | 5 votes |
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 ) ); } }
Example #30
Source File: MultiPageReportEditor.java From birt with Eclipse Public License 1.0 | 5 votes |
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; }