org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.pages.columns
Class ASAColumnsEditorPage

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.datatools.sqltools.common.ui.helpsystem.HelpSystemEditorPart
                  extended by org.eclipse.datatools.sqltools.schemaobjecteditor.ui.core.SchemaObjectEditorPage
                      extended by org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.ASATableSchemaEditorPage
                          extended by org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.pages.columns.ASAColumnsEditorPage
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, ICuttablePart, IEditableColumns, IValidatablePart, ISchemaObjectEditorModelListener, IDisablementPart, ISchemaObjectEditorPage, org.eclipse.help.IContextProvider, 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

public class ASAColumnsEditorPage
extends ASATableSchemaEditorPage
implements ISchemaObjectEditorPage, IValidatablePart, ICuttablePart, IEditableColumns

The "Columns" page for ASA

Author:
Idull

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.datatools.sqltools.schemaobjecteditor.ui.core.SchemaObjectEditorPage
SchemaObjectEditorPage.PageForm
 
Field Summary
static int COLUMN_FOCUS
           
 
Fields inherited from interface org.eclipse.datatools.sqltools.schemaobjecteditor.ui.ISchemaObjectEditorPage
UNKNOWN_ITEM_TYPE
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Fields inherited from interface org.eclipse.help.IContextProvider
NONE, SELECTION
 
Constructor Summary
ASAColumnsEditorPage()
           
ASAColumnsEditorPage(org.eclipse.ui.forms.editor.FormEditor editor, java.lang.String id, java.lang.String title)
           
ASAColumnsEditorPage(java.lang.String id, java.lang.String title)
           
 
Method Summary
 java.lang.String[] getPreferencePageIds()
          Returns the preference pages ids related to this editor page.
The returns preference pages will be displayed if user click "Preferences..." in the editor page's context menu
 void insertColumn()
           
 boolean isColumnsDirty()
          Checks if the columns have been modified
 void modelRegenerated()
          Do something when the model is re-generated, for example, after successfully saving the dirty editor, the edit model will be re-cloned from the refreshed database model, in this case, page should be refreshed to keep it synchronized with database
 void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
          Do something when the model change event occurs, generally we refresh this page, but since the refresh method is called when page changes (Lazy refresh), we dont need to refresh here.
 void populateSQLObjects(org.eclipse.swt.events.TypedEvent event)
          When populating the SQL object, should remove the "this" listener to avoid refresh itself
 boolean prepareCut()
          After this method is called and returns true, cut operation MUST proceed.
 void refresh()
          Refreshes the UI according to the new model.
MUST be careful when calling this method, coz it may overwrite what the user inputs if this method is called before the populateSQLObjects is called
 void revert()
          Does nothing but refresh the page according to the reverted model
 void setFocus(int itemType, java.lang.Object item)
          The default implementation sets the current page active
 IErrorItem[] validate(org.eclipse.swt.events.TypedEvent event)
          The default implementation of this method validate all the objects belong to this page and return the error items
 void validatePart(org.eclipse.swt.events.TypedEvent event)
          Validate this part, and may set error message accordingly
 
Methods inherited from class org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples.tableeditor.ASATableSchemaEditorPage
getPagesNotifier, validateAndShowErrorsAfterPopulating, validateOnline
 
Methods inherited from class org.eclipse.datatools.sqltools.schemaobjecteditor.ui.core.SchemaObjectEditorPage
aboutToSave, canLeaveThePage, createPartControl, dispose, doSave, doSaveAs, enable, getDatabaseIdentifier, getEditor, getEditorDescriptor, getErrorMsg, getId, getIndex, getManagedForm, getPageDescriptor, getPartControl, getTitleImage, init, initialize, isActive, isDirty, isEditor, isPageOpened, isSaveAsAllowed, markDirty, menuAboutToShow, selectReveal, setActive, setEditor, setEditorDescriptor, setFocus, setId, setIndex, setPageDescriptor, setPartName, validateAndShowErrors
 
Methods inherited from class org.eclipse.datatools.sqltools.common.ui.helpsystem.HelpSystemEditorPart
getContext, getContextChangeMask, getSearchExpression
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getAdapter, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.datatools.sqltools.schemaobjecteditor.ui.ISchemaObjectEditorPage
aboutToSave, getDatabaseIdentifier, getEditorDescriptor, getErrorMsg, getPageDescriptor, isPageOpened, markDirty, menuAboutToShow, setEditor, setEditorDescriptor, setId, setPageDescriptor, setPartName, validateAndShowErrors, validateOnline
 
Methods inherited from interface org.eclipse.ui.forms.editor.IFormPage
canLeaveThePage, getEditor, getId, getIndex, getManagedForm, getPartControl, initialize, isActive, isEditor, selectReveal, setActive, setIndex
 
Methods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSite, init
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
doSave, doSaveAs, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded
 
Methods inherited from interface org.eclipse.datatools.sqltools.schemaobjecteditor.ui.IDisablementPart
enable
 

Field Detail

COLUMN_FOCUS

public static final int COLUMN_FOCUS
See Also:
Constant Field Values
Constructor Detail

ASAColumnsEditorPage

public ASAColumnsEditorPage()

ASAColumnsEditorPage

public ASAColumnsEditorPage(org.eclipse.ui.forms.editor.FormEditor editor,
                            java.lang.String id,
                            java.lang.String title)

ASAColumnsEditorPage

public ASAColumnsEditorPage(java.lang.String id,
                            java.lang.String title)
Method Detail

populateSQLObjects

public void populateSQLObjects(org.eclipse.swt.events.TypedEvent event)
When populating the SQL object, should remove the "this" listener to avoid refresh itself

Specified by:
populateSQLObjects in interface ISchemaObjectEditorPage
Overrides:
populateSQLObjects in class SchemaObjectEditorPage
Parameters:
event - the edit event which changes the input

refresh

public void refresh()
Refreshes the UI according to the new model.
MUST be careful when calling this method, coz it may overwrite what the user inputs if this method is called before the populateSQLObjects is called

Specified by:
refresh in interface ISchemaObjectEditorPage
Overrides:
refresh in class ASATableSchemaEditorPage

revert

public void revert()
Does nothing but refresh the page according to the reverted model

Specified by:
revert in interface ISchemaObjectEditorPage
Overrides:
revert in class SchemaObjectEditorPage

validate

public IErrorItem[] validate(org.eclipse.swt.events.TypedEvent event)
Description copied from class: SchemaObjectEditorPage
The default implementation of this method validate all the objects belong to this page and return the error items

Specified by:
validate in interface ISchemaObjectEditorPage
Overrides:
validate in class SchemaObjectEditorPage
Returns:
the error items if this page is not valid, otherwise return null

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
Do something when the model change event occurs, generally we refresh this page, but since the refresh method is called when page changes (Lazy refresh), we dont need to refresh here.

Specified by:
notifyChanged in interface ISchemaObjectEditorModelListener
Overrides:
notifyChanged in class ASATableSchemaEditorPage
Parameters:
msg - the notification

modelRegenerated

public void modelRegenerated()
Description copied from interface: ISchemaObjectEditorPage
Do something when the model is re-generated, for example, after successfully saving the dirty editor, the edit model will be re-cloned from the refreshed database model, in this case, page should be refreshed to keep it synchronized with database

Specified by:
modelRegenerated in interface ISchemaObjectEditorPage
Overrides:
modelRegenerated in class ASATableSchemaEditorPage

getPreferencePageIds

public java.lang.String[] getPreferencePageIds()
Description copied from interface: ISchemaObjectEditorPage
Returns the preference pages ids related to this editor page.
The returns preference pages will be displayed if user click "Preferences..." in the editor page's context menu

Specified by:
getPreferencePageIds in interface ISchemaObjectEditorPage
Overrides:
getPreferencePageIds in class SchemaObjectEditorPage
Returns:

validatePart

public void validatePart(org.eclipse.swt.events.TypedEvent event)
Description copied from interface: IValidatablePart
Validate this part, and may set error message accordingly

Specified by:
validatePart in interface IValidatablePart

prepareCut

public boolean prepareCut()
After this method is called and returns true, cut operation MUST proceed.

Specified by:
prepareCut in interface ICuttablePart
Returns:

setFocus

public void setFocus(int itemType,
                     java.lang.Object item)
Description copied from class: SchemaObjectEditorPage
The default implementation sets the current page active

Specified by:
setFocus in interface ISchemaObjectEditorPage
Overrides:
setFocus in class SchemaObjectEditorPage
Parameters:
itemType - the type of the item, each page can define its own types
item - the object of the type, it can be null if the item type provides enough information

isColumnsDirty

public boolean isColumnsDirty()
Description copied from interface: IEditableColumns
Checks if the columns have been modified

Specified by:
isColumnsDirty in interface IEditableColumns
Returns:

insertColumn

public void insertColumn()