Class MetadataPerspective
- java.lang.Object
-
- org.apache.hop.ui.hopgui.perspective.metadata.MetadataPerspective
-
- All Implemented Interfaces:
IActionContextHandlersProvider,IHopPerspective,TabClosable
@HopPerspectivePlugin(id="200-HopMetadataPerspective", name="i18n::MetadataPerspective.Name", description="i18n::MetadataPerspective.Description", image="ui/images/metadata.svg") @GuiPlugin(description="i18n::MetadataPerspective.GuiPlugin.Description") public class MetadataPerspective extends Object implements IHopPerspective, TabClosable
-
-
Field Summary
Fields Modifier and Type Field Description static StringGUI_PLUGIN_TOOLBAR_PARENT_IDstatic StringKEY_HELPstatic Class<?>PKGstatic StringTOOLBAR_ITEM_DELETEstatic StringTOOLBAR_ITEM_DUPLICATEstatic StringTOOLBAR_ITEM_EDITstatic StringTOOLBAR_ITEM_NEWstatic StringTOOLBAR_ITEM_REFRESH
-
Constructor Summary
Constructors Constructor Description MetadataPerspective()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Switch to this perspective (shown).voidaddEditor(MetadataEditor<?> editor)voidcloseTab(org.eclipse.swt.custom.CTabFolderEvent event, org.eclipse.swt.custom.CTabItem tabItem)Close the tab on the perspectiveprotected voidcreateTabFolder(org.eclipse.swt.widgets.Composite parent)protected voidcreateTree(org.eclipse.swt.widgets.Composite parent)voidduplicateMetadata()MetadataEditor<?>findEditor(String objectKey, String name)Find a metadata editorMetadataEditor<?>getActiveEditor()IHopFileTypeHandlergetActiveFileTypeHandler()Get the active file type handler capable of saving, executing, printing, ...List<IGuiContextHandler>getContextHandlers()org.eclipse.swt.widgets.ControlgetControl()StringgetId()static MetadataPerspectivegetInstance()List<TabItemHandler>getItems()Get the list of tabs handled by and currently open in the perspectiveprotected MetadataManager<IHopMetadata>getMetadataManager(String objectKey)List<ISearchable>getSearchables()protected org.eclipse.swt.widgets.ShellgetShell()List<IHopFileType>getSupportedHopFileTypes()Get a list of supported file types for this perspectiveorg.eclipse.swt.custom.CTabFoldergetTabFolder()Get the tabFolder of the perspectivevoidgoToElement(Class<? extends IHopMetadata> managedClass, String elementName)voidgoToType(Class<? extends IHopMetadata> managedClass)booleanhasNavigationNextFile()booleanhasNavigationPreviousFile()voidinitialize(HopGui hopGui, org.eclipse.swt.widgets.Composite parent)Initialize this perspectivebooleanisActive()See if this perspective is active (shown)voidnavigateToNextFile()Navigate the file usage history to the next filevoidnavigateToPreviousFile()Navigate the file usage history to the previous filevoidonDeleteMetadata()voidonEditMetadata()voidonNewMetadata()voidonRenameMetadata()protected voidonTabClose(org.eclipse.swt.custom.CTabFolderEvent event)voidperspectiveActivated()Notify this perspective that it has been activated.voidrefresh()booleanremove(IHopFileTypeHandler typeHandler)Remove this file type handler from the perspectivevoidsetActiveEditor(MetadataEditor<?> editor)voidsetActiveFileTypeHandler(IHopFileTypeHandler fileTypeHandler)Set the focus on the given file type handler.voidupdateEditor(MetadataEditor<?> editor)voidupdateGui()Update HopGui menu and toolbar...protected voidupdateSelection()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hop.ui.hopgui.perspective.TabClosable
getOtherTabs, getTabsToLeft, getTabsToRight
-
-
-
-
Field Detail
-
PKG
public static final Class<?> PKG
-
GUI_PLUGIN_TOOLBAR_PARENT_ID
public static final String GUI_PLUGIN_TOOLBAR_PARENT_ID
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_NEW
public static final String TOOLBAR_ITEM_NEW
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_EDIT
public static final String TOOLBAR_ITEM_EDIT
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_DUPLICATE
public static final String TOOLBAR_ITEM_DUPLICATE
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_DELETE
public static final String TOOLBAR_ITEM_DELETE
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_REFRESH
public static final String TOOLBAR_ITEM_REFRESH
- See Also:
- Constant Field Values
-
KEY_HELP
public static final String KEY_HELP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static MetadataPerspective getInstance()
-
getId
public String getId()
- Specified by:
getIdin interfaceIHopPerspective
-
activate
@GuiKeyboardShortcut(control=true, shift=true, key=109) @GuiOsxKeyboardShortcut(command=true, shift=true, key=109) public void activate()
Description copied from interface:IHopPerspectiveSwitch to this perspective (shown).- Specified by:
activatein interfaceIHopPerspective
-
perspectiveActivated
public void perspectiveActivated()
Description copied from interface:IHopPerspectiveNotify this perspective that it has been activated.- Specified by:
perspectiveActivatedin interfaceIHopPerspective
-
isActive
public boolean isActive()
Description copied from interface:IHopPerspectiveSee if this perspective is active (shown)- Specified by:
isActivein interfaceIHopPerspective- Returns:
- True if the perspective is currently shown
-
getSupportedHopFileTypes
public List<IHopFileType> getSupportedHopFileTypes()
Description copied from interface:IHopPerspectiveGet a list of supported file types for this perspective- Specified by:
getSupportedHopFileTypesin interfaceIHopPerspective- Returns:
- The list of supported file types
-
initialize
public void initialize(HopGui hopGui, org.eclipse.swt.widgets.Composite parent)
Description copied from interface:IHopPerspectiveInitialize this perspective- Specified by:
initializein interfaceIHopPerspective- Parameters:
hopGui- The parent Hop GUI
-
getMetadataManager
protected MetadataManager<IHopMetadata> getMetadataManager(String objectKey) throws HopException
- Throws:
HopException
-
createTree
protected void createTree(org.eclipse.swt.widgets.Composite parent)
-
createTabFolder
protected void createTabFolder(org.eclipse.swt.widgets.Composite parent)
-
addEditor
public void addEditor(MetadataEditor<?> editor)
-
findEditor
public MetadataEditor<?> findEditor(String objectKey, String name)
Find a metadata editor- Parameters:
objectKey- the metadata annotation keyname- the name of the metadata- Returns:
- the metadata editor or null if not found
-
setActiveEditor
public void setActiveEditor(MetadataEditor<?> editor)
-
getActiveEditor
public MetadataEditor<?> getActiveEditor()
-
getActiveFileTypeHandler
public IHopFileTypeHandler getActiveFileTypeHandler()
Description copied from interface:IHopPerspectiveGet the active file type handler capable of saving, executing, printing, ... a file- Specified by:
getActiveFileTypeHandlerin interfaceIHopPerspective- Returns:
- The active file type handler
-
setActiveFileTypeHandler
public void setActiveFileTypeHandler(IHopFileTypeHandler fileTypeHandler)
Description copied from interface:IHopPerspectiveSet the focus on the given file type handler.- Specified by:
setActiveFileTypeHandlerin interfaceIHopPerspective
-
onTabClose
protected void onTabClose(org.eclipse.swt.custom.CTabFolderEvent event)
-
onNewMetadata
@GuiToolbarElement(root="MetadataPerspective-Toolbar", id="MetadataPerspective-Toolbar-10000-New", toolTip="i18n::MetadataPerspective.ToolbarElement.New.Tooltip", image="ui/images/new.svg") public void onNewMetadata()
-
onEditMetadata
public void onEditMetadata()
-
onRenameMetadata
@GuiToolbarElement(root="MetadataPerspective-Toolbar", id="MetadataPerspective-Toolbar-10010-Edit", toolTip="i18n::MetadataPerspective.ToolbarElement.Edit.Tooltip", image="ui/images/edit.svg") public void onRenameMetadata()
-
onDeleteMetadata
@GuiToolbarElement(root="MetadataPerspective-Toolbar", id="MetadataPerspective-Toolbar-10040-Delete", toolTip="i18n::MetadataPerspective.ToolbarElement.Delete.Tooltip", image="ui/images/delete.svg") public void onDeleteMetadata()
-
duplicateMetadata
@GuiToolbarElement(root="MetadataPerspective-Toolbar", id="MetadataPerspective-Toolbar-10030-Duplicate", toolTip="i18n::MetadataPerspective.ToolbarElement.CreateCopy.Tooltip", image="ui/images/duplicate.svg") public void duplicateMetadata()
-
updateEditor
public void updateEditor(MetadataEditor<?> editor)
-
updateGui
public void updateGui()
Update HopGui menu and toolbar...
-
refresh
@GuiToolbarElement(root="MetadataPerspective-Toolbar", id="MetadataPerspective-Toolbar-10100-Refresh", toolTip="i18n::MetadataPerspective.ToolbarElement.Refresh.Tooltip", image="ui/images/refresh.svg") @GuiKeyboardShortcut(key=16777230) @GuiOsxKeyboardShortcut(key=16777230) public void refresh()
-
updateSelection
protected void updateSelection()
-
remove
public boolean remove(IHopFileTypeHandler typeHandler)
Description copied from interface:IHopPerspectiveRemove this file type handler from the perspective- Specified by:
removein interfaceIHopPerspective- Parameters:
typeHandler- The file type handler to remove- Returns:
-
getItems
public List<TabItemHandler> getItems()
Description copied from interface:IHopPerspectiveGet the list of tabs handled by and currently open in the perspective- Specified by:
getItemsin interfaceIHopPerspective- Returns:
- The list of tab items
-
navigateToPreviousFile
public void navigateToPreviousFile()
Description copied from interface:IHopPerspectiveNavigate the file usage history to the previous file- Specified by:
navigateToPreviousFilein interfaceIHopPerspective
-
navigateToNextFile
public void navigateToNextFile()
Description copied from interface:IHopPerspectiveNavigate the file usage history to the next file- Specified by:
navigateToNextFilein interfaceIHopPerspective
-
hasNavigationPreviousFile
public boolean hasNavigationPreviousFile()
- Specified by:
hasNavigationPreviousFilein interfaceIHopPerspective
-
hasNavigationNextFile
public boolean hasNavigationNextFile()
- Specified by:
hasNavigationNextFilein interfaceIHopPerspective
-
getControl
public org.eclipse.swt.widgets.Control getControl()
- Specified by:
getControlin interfaceIHopPerspective- Returns:
- The control of this perspective
-
getShell
protected org.eclipse.swt.widgets.Shell getShell()
-
getContextHandlers
public List<IGuiContextHandler> getContextHandlers()
- Specified by:
getContextHandlersin interfaceIActionContextHandlersProvider
-
getSearchables
public List<ISearchable> getSearchables()
- Specified by:
getSearchablesin interfaceIHopPerspective- Returns:
- A list of searchable items
-
closeTab
public void closeTab(org.eclipse.swt.custom.CTabFolderEvent event, org.eclipse.swt.custom.CTabItem tabItem)Description copied from interface:TabClosableClose the tab on the perspective- Specified by:
closeTabin interfaceTabClosable
-
getTabFolder
public org.eclipse.swt.custom.CTabFolder getTabFolder()
Description copied from interface:TabClosableGet the tabFolder of the perspective- Specified by:
getTabFolderin interfaceTabClosable
-
goToType
public void goToType(Class<? extends IHopMetadata> managedClass)
-
goToElement
public void goToElement(Class<? extends IHopMetadata> managedClass, String elementName)
-
-