Java 类org.eclipse.ui.forms.editor.FormEditor 实例源码

项目:birt    文件:MasterPageSelectionAction.java   
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 );
}
项目:birt    文件:MultiPageReportEditor.java   
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 ) );
    }
}
项目:birt    文件:DebugScriptAction.java   
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$
        }   
    }
}
项目:eZooKeeper    文件:BaseOpenAction.java   
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;
}
项目:tlaplus    文件:AdvancedModelPage.java   
/**
 * 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";
}
项目:tlaplus    文件:ResultPage.java   
/**
 * 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";
}
项目:birt    文件:LibraryLayoutEditorFormPage.java   
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( ) );
    // }
}
项目:birt    文件:PreviewSupport.java   
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 );
}
项目:birt    文件:PreviewSupport.java   
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 );
}
项目:birt    文件:UIUtil.java   
/**
 * 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;
}
项目:birt    文件:UIUtil.java   
public static void refreshCurrentEditorMarkers( )
{
    FormEditor editor = UIUtil.getActiveReportEditor( );
    if ( editor instanceof AbstractMultiPageEditor )
    {
        try
        {
            ( (AbstractMultiPageEditor) editor ).refreshMarkers( editor.getEditorInput( ) );
        }
        catch ( CoreException e )
        {
        }
    }
}
项目:birt    文件:PageSetAction.java   
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 ) );
    }
}
项目:birt    文件:MultiPageReportEditor.java   
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;
}
项目:birt    文件:DebugStartupClass.java   
/**
 * 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;

}
项目:olca-app    文件:Toolbar.java   
@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();
    }));
}
项目:olca-app    文件:TotalImpactResultPage.java   
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;
}
项目:olca-app    文件:InventoryPage.java   
public InventoryPage(FormEditor editor, ContributionResultProvider<?> result, DQResult dqResult,
        CalculationSetup setup) {
    super(editor, "InventoryPage", M.InventoryResults);
    this.result = result;
    this.setup = setup;
    this.dqResult = dqResult;
}
项目:olca-app    文件:ContributionTreePage.java   
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();
}
项目:olca-app    文件:ProcessResultPage.java   
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);
}
项目:bdf2    文件:DeploymentPage.java   
public DeploymentPage(FormEditor editor,GraphicalViewer graphicalViewer,String title) {
    super(editor,DeploymentPage.class.getName(), title);
    this.graphicalViewer=graphicalViewer;
}
项目:dawn-marketplace-server    文件:OverviewPage.java   
public OverviewPage(FormEditor editor, String id, String title, Node solution) {
    super(editor, id, title);
    this.solution = solution;
}
项目:dawn-marketplace-server    文件:DescriptionPage.java   
public DescriptionPage(FormEditor editor, String id, String title, Node solution, IEditorSite site) {
    super(editor, id, title);
    this.solution = solution;
    this.site = site;
}
项目:eclemma    文件:ExecutedClassesPage.java   
public ExecutedClassesPage(FormEditor parent, ExecutionDataContent content) {
  super(parent, "classes", ExecutionDataEditorExecutedClassesPage_title); //$NON-NLS-1$
  this.content = content;
  this.refreshJob = new RefreshJob();
}
项目:eclemma    文件:SessionDataPage.java   
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);
}
项目:tlaplus    文件:PDFViewingPage.java   
public PDFViewingPage(FormEditor editor, String id, String title)
{
    super(editor, id, title);
}
项目:tlaplus    文件:MainModelPage.java   
/**
     * 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);
}
项目:HMM    文件:AutomationPage.java   
public AutomationPage(FormEditor editor) {
    super(editor, "hmm.automation.AutomationPage", editor.getEditorInput().getName());
    block = new AutomationBlock(this);
}
项目:thym    文件:EssentialsPage.java   
public EssentialsPage(FormEditor editor) {
    super(editor, "essentials", "Overview");
    formToolkit = editor.getToolkit();
}
项目:thym    文件:AbstactConfigEditorPage.java   
public AbstactConfigEditorPage(FormEditor editor, String id, String title) {
    super(editor, id, title);
}
项目:thym    文件:PropertiesPage.java   
public PropertiesPage(FormEditor editor) {
    super(editor, "properties", "Platform Properties");
    formToolkit = editor.getToolkit();
}
项目:thym    文件:IconsPage.java   
public IconsPage(FormEditor editor) {
    super(editor, "icons", "Icons && Splash Screen");
    formToolkit = editor.getToolkit();
}
项目:ant-ivyde    文件:OverviewFormPage.java   
/**
 * @param editor FormEditor
 */
public OverviewFormPage(FormEditor editor) {
    super(editor, "overview", "Overview");
}
项目:birt    文件:LibraryLayoutEditorFormPage.java   
public void initialize( FormEditor editor )
{
    this.editor = editor;
}
项目:birt    文件:LibraryLayoutEditorFormPage.java   
public FormEditor getEditor( )
{
    return editor;
}
项目:birt    文件:ReportXMLSourceEditorFormPage.java   
public void initialize( FormEditor editor )
{
    this.editor = editor;
    setRangeIndicator( new Annotation( ) {
    } );
}
项目:birt    文件:ReportXMLSourceEditorFormPage.java   
public FormEditor getEditor( )
{
    return editor;
}
项目:birt    文件:ReportFormPage.java   
public void initialize( FormEditor editor )
{
    this.editor = editor;
}
项目:birt    文件:ReportFormPage.java   
public FormEditor getEditor( )
{
    return editor;
}
项目:birt    文件:ReportLayoutEditorFormPage.java   
public void initialize( FormEditor editor )
{
    this.editor = editor;
}
项目:birt    文件:ReportLayoutEditorFormPage.java   
public FormEditor getEditor( )
{
    return editor;
}