Class AbstractFormPage
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.eclipse.ui.forms.editor.FormPage
-
- com._1c.g5.ides.ui.formeditor.AbstractFormPage
-
- All Implemented Interfaces:
IIssueAcceptor
,org.eclipse.core.runtime.IAdaptable
,org.eclipse.core.runtime.IExecutableExtension
,org.eclipse.ui.forms.editor.IFormPage
,org.eclipse.ui.IEditorPart
,org.eclipse.ui.ISaveablePart
,org.eclipse.ui.IWorkbenchPart
,org.eclipse.ui.IWorkbenchPart2
,org.eclipse.ui.IWorkbenchPart3
,org.eclipse.ui.part.IWorkbenchPartOrientation
- Direct Known Subclasses:
AbstractFormPage
public abstract class AbstractFormPage extends org.eclipse.ui.forms.editor.FormPage implements IIssueAcceptor
Abstract form page for multipage editor.This form listens selections from multipage editor's selection provider and executes
selectAndReveal(IStructuredSelection)
when selection changedForm page content is provided by
createPageContent(Composite, IManagedForm)
, if there is critical errors in resource form page content replaced with content provided bycreatePageErrorContent(Composite, IManagedForm)
When page was switched or underlying content was changed method
doRefresh(boolean)
is automatically triggered, after that#showIssues(List, IProgressMonitor)
is executed. Clients can affect on triggering ofdoRefresh(boolean)
method by overridingneedsRefresh()
-
-
Field Summary
Fields Modifier and Type Field Description protected String
errorTitle
protected boolean
fullRefresh
protected org.eclipse.ui.forms.IMessageManager
messageManager
protected String
pageTitle
-
Constructor Summary
Constructors Constructor Description AbstractFormPage(AbstractMultiPageEditor editor, String id, String title)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept(List<org.eclipse.xtext.validation.Issue> issues)
This method is called byCustomResourceValidator
after getting validation issues.protected void
beforeFullRefresh()
Executes before performing full refreshprotected void
createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
Creates form parent composite.protected abstract void
createPageContent(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.IManagedForm managedForm)
Creates form contentprotected void
createPageErrorContent(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.IManagedForm managedForm)
Form content for the case of critical errors in the model.void
dispose()
protected abstract void
doAcceptIssues(List<org.eclipse.xtext.validation.Issue> issues)
This method is invoked after validation is completed.protected abstract void
doRefresh(boolean performFullRefresh)
Refreshes formAbstractMultiPageEditor
getEditor()
org.eclipse.handly.model.ISourceFile
getSourceFile()
ReturnsISourceFile
for modelprotected boolean
needsRefresh()
Returns true if the form should be refreshed.protected abstract void
selectAndReveal(org.eclipse.jface.viewers.IStructuredSelection selection)
Executed when page gets selection change notificationvoid
setErrorTitle(String errorTitle)
Sets page title if there is critical errors in model.void
setPageTitle(String pageTitle)
Sets page title.protected void
showError()
-
Methods inherited from class org.eclipse.ui.forms.editor.FormPage
canLeaveThePage, createPartControl, doSave, doSaveAs, getId, getIndex, getManagedForm, getPartControl, getTitleImage, init, initialize, isActive, isDirty, isEditor, isSaveAsAllowed, selectReveal, setActive, setFocus, setIndex
-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Constructor Detail
-
AbstractFormPage
public AbstractFormPage(AbstractMultiPageEditor editor, String id, String title)
Constructor- Parameters:
editor
- multipage editor (notnull
)id
- form page id (notnull
)title
- the page title (notnull
)
-
-
Method Detail
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
dispose
in classorg.eclipse.ui.forms.editor.FormPage
-
accept
public void accept(List<org.eclipse.xtext.validation.Issue> issues)
Description copied from interface:IIssueAcceptor
This method is called byCustomResourceValidator
after getting validation issues.Note: This method is called by the platform; it is not intended to be called directly by clients.
- Specified by:
accept
in interfaceIIssueAcceptor
- Parameters:
issues
- - validation issues list, notnull
-
getEditor
public AbstractMultiPageEditor getEditor()
- Specified by:
getEditor
in interfaceorg.eclipse.ui.forms.editor.IFormPage
- Overrides:
getEditor
in classorg.eclipse.ui.forms.editor.FormPage
-
getSourceFile
public org.eclipse.handly.model.ISourceFile getSourceFile()
ReturnsISourceFile
for model- Returns:
- root element handle (never
null
)
-
setPageTitle
public void setPageTitle(String pageTitle)
Sets page title.- Parameters:
pageTitle
- the page title (notnull
)
-
setErrorTitle
public void setErrorTitle(String errorTitle)
Sets page title if there is critical errors in model.- Parameters:
errorTitle
- the error page title (notnull
)
-
beforeFullRefresh
protected void beforeFullRefresh()
Executes before performing full refresh
-
createFormContent
protected void createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
Creates form parent composite.This method is not intended to be overridden by clients.
- Overrides:
createFormContent
in classorg.eclipse.ui.forms.editor.FormPage
-
createPageContent
protected abstract void createPageContent(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.IManagedForm managedForm)
Creates form content- Parameters:
parent
- parent composite (notnull
)managedForm
-IManagedForm
instance (notnull
)
-
createPageErrorContent
protected void createPageErrorContent(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.IManagedForm managedForm)
Form content for the case of critical errors in the model.- Parameters:
parent
- parent composite (notnull
)managedForm
-IManagedForm
instance (notnull
)
-
doAcceptIssues
protected abstract void doAcceptIssues(List<org.eclipse.xtext.validation.Issue> issues)
This method is invoked after validation is completed.- Parameters:
issues
- validation issues, notnull
-
doRefresh
protected abstract void doRefresh(boolean performFullRefresh)
Refreshes form- Parameters:
performFullRefresh
- indicates that form should be fully refreshed (for example for viewers should be set a new input)
-
needsRefresh
protected boolean needsRefresh()
Returns true if the form should be refreshed.By default this method returns true.
- Returns:
- true if form content should be refreshed, false otherwise
-
selectAndReveal
protected abstract void selectAndReveal(org.eclipse.jface.viewers.IStructuredSelection selection)
Executed when page gets selection change notification- Parameters:
selection
- new selection
-
showError
protected void showError()
-
-