Package org.apache.hop.ui.core.metadata
Class MetadataEditor<T extends IHopMetadata>
- java.lang.Object
-
- org.apache.hop.ui.core.metadata.MetadataFileTypeHandler
-
- org.apache.hop.ui.core.metadata.MetadataEditor<T>
-
- All Implemented Interfaces:
IMetadataEditor<T>,IActionContextHandlersProvider,IHopFileTypeHandler
- Direct Known Subclasses:
DatabaseMetaEditor,ExecutionDataProfileEditor,ExecutionInfoLocationEditor,HopServerEditor,PartitionSchemaEditor,PipelineRunConfigurationEditor,WebServiceEditor,WorkflowRunConfigurationEditor
public abstract class MetadataEditor<T extends IHopMetadata> extends MetadataFileTypeHandler implements IMetadataEditor<T>
Abstract implementation of all metadata editors.
-
-
Field Summary
Fields Modifier and Type Field Description protected HopGuihopGuiprotected org.eclipse.swt.graphics.Imageimageprotected booleanisChangedprotected MetadataManager<T>managerprotected Tmetadataprotected StringoriginalNameprotected Stringtitleprotected org.eclipse.swt.graphics.ImagetitleImageprotected StringtoolTip
-
Constructor Summary
Constructors Constructor Description MetadataEditor(HopGui hopGui, MetadataManager<T> manager, T metadata)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.widgets.Button[]createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)protected org.eclipse.swt.widgets.ButtoncreateHelpButton(org.eclipse.swt.widgets.Shell shell)voiddispose()booleanequals(Object o)HopGuigetHopGui()org.eclipse.swt.graphics.ImagegetImage()TgetMetadata()MetadataManager<T>getMetadataManager()org.eclipse.swt.widgets.ShellgetShell()StringgetTitle()Return the title of the editororg.eclipse.swt.graphics.ImagegetTitleImage()Returns the title image of this editorStringgetTitleToolTip()Returns the title tool tip text of this editorabstract voidgetWidgetsContent(T meta)Inline usage: Reads the information or state of the various widgets and modifies the provided metadata object.booleanhasChanged()See if there anything has been changed by the userinthashCode()booleanisCloseable()Perform any task needed to close a file, save it if neededvoidresetChanged()Clear the changed flagvoidsave()Save the file without asking for a new filenamevoidsaveAs(String filename)Save the file after asking for a filenamevoidsetChanged()Flag the editor as changedbooleansetFocus()protected voidsetImage(org.eclipse.swt.graphics.Image image)voidsetMetadata(T metadata)protected voidsetTitle(String title)protected voidsetTitleImage(org.eclipse.swt.graphics.Image image)protected voidsetTitleToolTip(String toolTip)abstract voidsetWidgetsContent()Inline usage: copy information from the metadata onto the various widgetsvoidupdateGui()Update the toolbar, menus and so on.-
Methods inherited from class org.apache.hop.ui.core.metadata.MetadataFileTypeHandler
applyStateProperties, close, copySelectedToClipboard, cutSelectedToClipboard, debug, deleteSelected, getContextHandlers, getFilename, getFileType, getName, getStateProperties, getSubject, getVariables, pasteFromClipboard, pause, preview, redo, redraw, resume, selectAll, setFilename, setName, start, stop, undo, unselectAll
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hop.ui.hopgui.file.IHopFileTypeHandler
markDeleted, reload
-
Methods inherited from interface org.apache.hop.ui.core.metadata.IMetadataEditor
createControl
-
-
-
-
Field Detail
-
hopGui
protected HopGui hopGui
-
manager
protected MetadataManager<T extends IHopMetadata> manager
-
metadata
protected T extends IHopMetadata metadata
-
title
protected String title
-
toolTip
protected String toolTip
-
titleImage
protected org.eclipse.swt.graphics.Image titleImage
-
image
protected org.eclipse.swt.graphics.Image image
-
isChanged
protected boolean isChanged
-
originalName
protected String originalName
-
-
Constructor Detail
-
MetadataEditor
public MetadataEditor(HopGui hopGui, MetadataManager<T> manager, T metadata)
-
-
Method Detail
-
createButtonsForButtonBar
public org.eclipse.swt.widgets.Button[] createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
-
createHelpButton
protected org.eclipse.swt.widgets.Button createHelpButton(org.eclipse.swt.widgets.Shell shell)
-
getHopGui
public HopGui getHopGui()
-
getMetadataManager
public MetadataManager<T> getMetadataManager()
-
getMetadata
public T getMetadata()
- Specified by:
getMetadatain interfaceIMetadataEditor<T extends IHopMetadata>
-
setMetadata
public void setMetadata(T metadata)
- Specified by:
setMetadatain interfaceIMetadataEditor<T extends IHopMetadata>
-
getShell
public org.eclipse.swt.widgets.Shell getShell()
-
getImage
public org.eclipse.swt.graphics.Image getImage()
-
setImage
protected void setImage(org.eclipse.swt.graphics.Image image)
-
getTitle
public String getTitle()
Description copied from interface:IMetadataEditorReturn the title of the editor- Specified by:
getTitlein interfaceIMetadataEditor<T extends IHopMetadata>- Returns:
- The title of this editor
-
setTitle
protected void setTitle(String title)
-
getTitleImage
public org.eclipse.swt.graphics.Image getTitleImage()
Description copied from interface:IMetadataEditorReturns the title image of this editor- Specified by:
getTitleImagein interfaceIMetadataEditor<T extends IHopMetadata>- Returns:
-
setTitleImage
protected void setTitleImage(org.eclipse.swt.graphics.Image image)
-
getTitleToolTip
public String getTitleToolTip()
Description copied from interface:IMetadataEditorReturns the title tool tip text of this editor- Specified by:
getTitleToolTipin interfaceIMetadataEditor<T extends IHopMetadata>- Returns:
-
setTitleToolTip
protected void setTitleToolTip(String toolTip)
-
hasChanged
public boolean hasChanged()
Description copied from interface:IHopFileTypeHandlerSee if there anything has been changed by the user- Specified by:
hasChangedin interfaceIHopFileTypeHandler- Specified by:
hasChangedin interfaceIMetadataEditor<T extends IHopMetadata>- Overrides:
hasChangedin classMetadataFileTypeHandler- Returns:
- true if there were changes worth saving, false if nothing has been changed.
-
resetChanged
public void resetChanged()
Description copied from interface:IMetadataEditorClear the changed flag- Specified by:
resetChangedin interfaceIMetadataEditor<T extends IHopMetadata>
-
setChanged
public void setChanged()
Description copied from interface:IMetadataEditorFlag the editor as changed- Specified by:
setChangedin interfaceIMetadataEditor<T extends IHopMetadata>
-
setWidgetsContent
public abstract void setWidgetsContent()
Inline usage: copy information from the metadata onto the various widgets
-
getWidgetsContent
public abstract void getWidgetsContent(T meta)
Inline usage: Reads the information or state of the various widgets and modifies the provided metadata object.- Parameters:
meta- The metadata object to populate from the widgets
-
isCloseable
public boolean isCloseable()
Description copied from interface:IHopFileTypeHandlerPerform any task needed to close a file, save it if needed- Specified by:
isCloseablein interfaceIHopFileTypeHandler- Overrides:
isCloseablein classMetadataFileTypeHandler- Returns:
- true if the file is ready to close. Return false if there was a problem saving or any other issue.
-
save
public void save() throws HopExceptionDescription copied from interface:IHopFileTypeHandlerSave the file without asking for a new filename- Specified by:
savein interfaceIHopFileTypeHandler- Specified by:
savein interfaceIMetadataEditor<T extends IHopMetadata>- Overrides:
savein classMetadataFileTypeHandler- Throws:
HopException
-
saveAs
public void saveAs(String filename) throws HopException
Description copied from interface:IHopFileTypeHandlerSave the file after asking for a filename- Specified by:
saveAsin interfaceIHopFileTypeHandler- Specified by:
saveAsin interfaceIMetadataEditor<T extends IHopMetadata>- Overrides:
saveAsin classMetadataFileTypeHandler- Throws:
HopException
-
setFocus
public boolean setFocus()
- Specified by:
setFocusin interfaceIMetadataEditor<T extends IHopMetadata>
-
dispose
public void dispose()
- Specified by:
disposein interfaceIMetadataEditor<T extends IHopMetadata>
-
updateGui
public void updateGui()
Description copied from interface:IHopFileTypeHandlerUpdate the toolbar, menus and so on. This is needed after a file, context or capabilities changes- Specified by:
updateGuiin interfaceIHopFileTypeHandler- Overrides:
updateGuiin classMetadataFileTypeHandler
-
-