This proposal simplify the creation of perspective and facilitate a change
of presentation in the future
- Manage image with @HopPerspectivePlugin annotation ( add "image"
attribute )
- Do not use @GuiToolbarElement for perspective, but create and manage
the perspective activation with toolbar item directly in HopGui.
- Create a toolbar item with the SWT.RADIO flag better visibility and to
have a single image
- Remove from the interface IHopPerspective method show() and hide(),
use only activate()
- Add to the interface IHopPerspective method perspectiveActivated() to
notify this perspective that it has been activated.
- Create interface IHopPerspectiveListener to notify perspective
activation with method perspectiveActivated ( IHopPerspective )
- Add to class PerspectiveManager methods to addPerspectiveListener()
and removePerspectiveListener();
- Remove from the interface IHopPerspective method getFormData () not
very useful
Example of code simplification
@HopPerspectivePlugin(
id = "HopDataOrchestrationPerspective",
name = "Data Orchestration",
description = "The Hop Data Orchestration Perspective for pipelines
and workflows",
++ image = "ui/images/pipeline.svg"
)
-- @GuiToolbarElement(
-- root = HopGui.GUI_PLUGIN_PERSPECTIVES_PARENT_ID,
-- id = ID_PERSPECTIVE_TOOLBAR_ITEM,
-- image = "ui/images/pipeline.svg",
-- toolTip = "Data Orchestration"
-- )
/*
Activate a perspective and show it in gui
or use alternative:
HopGui.getPerspectiveManager().showPerspective(Class<? extends
IHopPerspective>);
HopGui.setActivePerspective (IHopPerspective>);
*/
@Override public void activate() {
hopGui.setActivePerspective( this );
}
-- @Override public void show() {
-- composite.setVisible( true );
-- hopGui.getPerspectivesToolbarWidgets().findToolItem(
ID_PERSPECTIVE_TOOLBAR_ITEM ).setImage(
GuiResource.getInstance().getImageToolbarDataOrchestration() );
-- }
-- @Override public void hide() {
-- composite.setVisible( false );
-- hopGui.getPerspectivesToolbarWidgets().findToolItem(
ID_PERSPECTIVE_TOOLBAR_ITEM ).setImage(
GuiResource.getInstance().getImageToolbarDataOrchestrationInactive() );
-- }
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Garanti
sans virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>