本文整理汇总了Java中org.eclipse.ui.forms.editor.FormEditor类的典型用法代码示例。如果您正苦于以下问题:Java FormEditor类的具体用法?Java FormEditor怎么用?Java FormEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormEditor类属于org.eclipse.ui.forms.editor包,在下文中一共展示了FormEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MasterPageSelectionAction
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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 );
}
示例2: setSelection
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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 ) );
}
}
示例3: run
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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$
}
}
}
示例4: open
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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;
}
示例5: AdvancedModelPage
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
/**
* 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";
}
示例6: ResultPage
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
/**
* 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";
}
示例7: init
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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( ) );
// }
}
示例8: preview
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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 );
}
示例9: getProjectFolder
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
/**
* 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;
}
示例10: refreshCurrentEditorMarkers
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
public static void refreshCurrentEditorMarkers( )
{
FormEditor editor = UIUtil.getActiveReportEditor( );
if ( editor instanceof AbstractMultiPageEditor )
{
try
{
( (AbstractMultiPageEditor) editor ).refreshMarkers( editor.getEditorInput( ) );
}
catch ( CoreException e )
{
}
}
}
示例11: update
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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 ) );
}
}
示例12: getSelection
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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;
}
示例13: getActiveReportEditor
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
/**
* 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;
}
示例14: contributeToToolBar
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
@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();
}));
}
示例15: TotalImpactResultPage
import org.eclipse.ui.forms.editor.FormEditor; //导入依赖的package包/类
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;
}