本文整理汇总了Java中org.eclipse.ui.forms.editor.IFormPage类的典型用法代码示例。如果您正苦于以下问题:Java IFormPage类的具体用法?Java IFormPage怎么用?Java IFormPage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFormPage类属于org.eclipse.ui.forms.editor包,在下文中一共展示了IFormPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPage
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void addPage(int index, IFormPage page) throws PartInitException {
if (!(page instanceof DataModelFormPage<?>)) {
throw new PartInitException("Invalid Page: Must be " + DataModelFormPage.class.getName());
}
DataModelFormPage<M> dataModelFormPage = (DataModelFormPage<M>) page;
super.addPage(index, page);
_Pages.add(index, dataModelFormPage);
Image pageImage = dataModelFormPage.getImage();
if (pageImage != null) {
setPageImage(index, pageImage);
}
}
示例2: setFocus
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void setFocus() {
super.setFocus();
RefreshAction refreshAction = getRefreshAction();
if (refreshAction != null) {
refreshAction.updateState();
}
IFormPage formPage = getActivePageInstance();
if (formPage == null) {
return;
}
if (!(formPage instanceof DataModelFormPage<?>)) {
return;
}
DataModelFormPage<M> dataModelFormPage = (DataModelFormPage<M>) formPage;
dataModelFormPage.forceLayout();
}
示例3: showResultPage
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* Show the result page of the editor
*/
public void showResultPage()
{
// goto result page
IFormPage resultPage = setActivePage(ResultPage.ID);
if (resultPage != null)
{
try
{
((ResultPage) resultPage).loadData();
} catch (CoreException e)
{
TLCUIActivator.getDefault().logError("Error refreshing the result page", e);
}
}
}
示例4: execute
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException
{
IEditorPart activeEditor = UIHelper.getActiveEditor();
if (activeEditor != null)
{
if (activeEditor instanceof ModelEditor)
{
ModelEditor activeModelEditor = (ModelEditor) activeEditor;
IFormPage page = activeModelEditor.getActivePageInstance();
if (page instanceof BasicFormPage)
{
BasicFormPage activePage = (BasicFormPage) page;
activePage.doRun();
}
}
}
return null;
}
示例5: commitFormPages
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* 모든 폼 페이지의 변경사항을 모델에 반영
*
* void
*/
protected void commitFormPages() {
IFormPage[] pages = getFormPages();
IFormPage page = null;
IManagedForm managedForm = null;
for (int i = 0; i < pages.length; i++) {
page = pages[i];
managedForm = page.getManagedForm();
if (managedForm != null && managedForm.isDirty()) {
managedForm.commit(true);
// managedForm.refresh();
}
}
}
示例6: saveModel
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* Saves input code to model
*/
private void saveModel( )
{
if ( isCodeModified( ) && editObject instanceof DesignElementHandle )
{
saveEditorContentsDE( (DesignElementHandle) editObject,
isSaveScript );
}
setIsModified( false );
( (IFormPage) getParentEditor( ) ).getEditor( )
.editorDirtyStateChanged( );
firePropertyChange( PROP_DIRTY );
SourceViewer viewer = getViewer( );
IUndoManager undoManager = viewer == null ? null
: viewer.getUndoManager( );
if ( undoManager != null )
{
undoManager.endCompoundChange( );
}
cleanPoint = getUndoLevel( );
}
示例7: markDirty
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
protected void markDirty( )
{
if ( !isModified )
{
setIsModified( true );
( (IFormPage) getParentEditor( ) ).getEditor( )
.editorDirtyStateChanged( );
firePropertyChange( PROP_DIRTY );
}
if ( cleanPoint > getUndoLevel( ) && !undoing )
{
cleanPoint = -1;
}
}
示例8: updateActionBarContributor
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* Notifies action bar contributor about page change.
*
* @param pageIndex
* the index of the new page
*/
protected void updateActionBarContributor( int pageIndex )
{
super.updateActionBarContributor( pageIndex );
// Overwrite this method to implement multi-editor action bar
// contributor
IEditorActionBarContributor contributor = getEditorSite( ).getActionBarContributor( );
if ( contributor instanceof IMultiPageEditorActionBarContributor
&& pageIndex >= 0
&& pageIndex < pages.size( ) )
{
Object page = pages.get( pageIndex );
if ( page instanceof IFormPage )
{
( (IMultiPageEditorActionBarContributor) contributor ).setActivePage( (IFormPage) page );
}
}
}
示例9: updateOutLineView
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
private void updateOutLineView( IFormPage activePageInstance )
{
if ( outlinePage == null )
{
return;
}
if ( reloadOutlinePage( ) )
{
return;
}
Object designOutLinePage = activePageInstance.getAdapter( IContentOutlinePage.class );
if ( designOutLinePage instanceof DesignerOutlinePage )
{
( (DesignerOutlinePage) designOutLinePage ).setBackupState( outlineBackup );
}
outlinePage.setActivePage( (IPageBookViewPage) designOutLinePage );
}
示例10: refreshGraphicalEditor
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
private void refreshGraphicalEditor( )
{
for ( int i = 0; i < pages.size( ); i++ )
{
Object page = pages.get( i );
if ( page instanceof IFormPage )
{
if ( isGraphicalEditor( page ) )
{
if ( ( (GraphicalEditorWithFlyoutPalette) page ).getGraphicalViewer( ) != null )
{
EditPart root = ( (GraphicalEditorWithFlyoutPalette) page ).getGraphicalViewer( )
.getRootEditPart( );
refreshResourceEditPart( root );
}
}
}
}
}
示例11: removeMetamodel
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
protected void removeMetamodel() {
if (listMetamodels.getSelection() instanceof IStructuredSelection) {
Iterator it = ((IStructuredSelection) listMetamodels.getSelection()).iterator();
while (it.hasNext()) {
Metamodel mm = (Metamodel) it.next();
if (atlTransformation.getMetamodels().remove(mm)) {
IFormPage p = this.getEditor().findPage(mm.getName());
if (p != null)
this.getEditor().removePage(p.getIndex());
}
}
markAsDirty();
listMetamodels.refresh();
}
}
示例12: IvyInfoSection
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
public IvyInfoSection(IFormPage page, Composite parent, int style, boolean titleBar) {
super(parent, page.getManagedForm().getToolkit(),
titleBar ? (ExpandableComposite.TITLE_BAR | style) : style);
this.page = page;
createClient(getSection(), page.getEditor().getToolkit());
getSection().setText("General Information");
// ((IvyFileEditorInput)page.getEditorInput()).addPropertyChangeListener(this);
}
示例13: preview
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的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 );
}
示例14: removePage
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* Remove report editor page.
*
* @param id
* the page id.
*/
public void removePage( String id )
{
IFormPage page = findPage( id );
if ( page != null )
{
removePage( page.getIndex( ) );
}
}
示例15: removeAllPages
import org.eclipse.ui.forms.editor.IFormPage; //导入依赖的package包/类
/**
* Remove all report editor page.
*/
public void removeAllPages( )
{
for ( int i = pages.toArray( ).length - 1; i >= 0; i-- )
{
if ( pages.get( i ) != null )
this.removePage( ( (IFormPage) pages.get( i ) ).getId( ) );
}
}