Skip to content
Permalink
Browse files
Merge pull request #460 from nadment/HOP-2283
HOP-2283 Rename annotation HopMetadata.iconImage > image
  • Loading branch information
mattcasters committed Dec 14, 2020
2 parents 7e3b1e4 + 92388ab commit db9b484e87a41d26a229e86e15af12fe8f3df9a1
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 23 deletions.
@@ -64,7 +64,7 @@
key = "rdbms",
name = "Relational Database Connection",
description = "This contains all the metadata needed to connect to a relational database",
iconImage = "ui/images/CNC.svg")
image = "ui/images/CNC.svg")
public class DatabaseMeta extends HopMetadataBase implements Cloneable, IHopMetadata {
private static final Class<?> PKG = Database.class; // Needed by Translator

@@ -43,5 +43,5 @@

String description() default "";

String iconImage() default "ui/images/folder.svg";
String image() default "ui/images/folder.svg";
}
@@ -78,7 +78,7 @@ protected String extractName( HopMetadata annotation ) {

@Override
protected String extractImageFile( HopMetadata annotation ) {
return annotation.iconImage();
return annotation.image();
}

@Override
@@ -37,7 +37,7 @@
key = "partition",
name = "Partition Schema",
description = "Describes a partition schema",
iconImage = "ui/images/partition_schema.svg"
image = "ui/images/partition_schema.svg"
)
public class PartitionSchema extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -32,7 +32,7 @@
key = "pipeline-run-configuration",
name = "Pipeline Run Configuration",
description = "Describes how and with which engine a pipeline is to be executed",
iconImage = "ui/images/run.svg"
image = "ui/images/run.svg"
)
public class PipelineRunConfiguration extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -96,7 +96,7 @@
key = "server",
name = "Hop Server",
description = "Defines a Hop Hop Server",
iconImage = "ui/images/server.svg"
image = "ui/images/server.svg"
)
public class HopServer extends HopMetadataBase implements Cloneable, IXml, IHopMetadata {
private static final Class<?> PKG = HopServer.class; // Needed by Translator
@@ -18,8 +18,6 @@

package org.apache.hop.workflow.config;

import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.variables.Variables;
import org.apache.hop.metadata.api.HopMetadata;
import org.apache.hop.metadata.api.HopMetadataBase;
import org.apache.hop.metadata.api.HopMetadataProperty;
@@ -29,7 +27,7 @@
key = "workflow-run-configuration",
name = "Workflow Run Configuration",
description = "Describes how to execute a workflow",
iconImage = "ui/images/run.svg"
image = "ui/images/run.svg"
)
public class WorkflowRunConfiguration extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -36,7 +36,7 @@
key = "file-definition",
name = "Beam File Definition",
description = "Describes a file layout in a Beam pipeline",
iconImage = "ui/images/folder.svg"
image = "ui/images/folder.svg"
)
public class FileDefinition extends HopMetadataBase implements Serializable, IHopMetadata {

@@ -29,7 +29,7 @@
key = "git",
name = "Git Repository",
description = "This defines a Git repository",
iconImage = "git_icon.svg")
image = "git_icon.svg")
public class GitRepository extends HopMetadataBase implements Cloneable, IHopMetadata {

public static final String EXTENSION_POINT_ID_GIT_REPOSITORY_CREATION = "GitRepositoryCreate";
@@ -41,7 +41,7 @@
key = "dataset",
name = "Data Set",
description = "This defines a data set, a static pre-defined collection of rows",
iconImage = "dataset.svg"
image = "dataset.svg"
)
public class DataSet extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -49,7 +49,7 @@
key = "unit-test",
name = "Pipeline Unit Test",
description = "This describes a test for a pipeline with alternative data sets as input from certain transform and testing output against golden data",
iconImage = "Test_tube_icon.svg"
image = "Test_tube_icon.svg"
)
public class PipelineUnitTest extends HopMetadataBase implements Cloneable, IHopMetadata {

@@ -76,7 +76,7 @@ public MetadataEditor(HopGui hopGui, MetadataManager<T> manager, T metadata) {
this.setTitleImage(
GuiResource.getInstance()
.getImage(
annotation.iconImage(),
annotation.image(),
managedClass.getClassLoader(),
ConstUi.SMALL_ICON_SIZE,
ConstUi.SMALL_ICON_SIZE));
@@ -86,7 +86,7 @@ public MetadataEditor(HopGui hopGui, MetadataManager<T> manager, T metadata) {
SwtSvgImageUtil.getImage(
hopGui.getDisplay(),
managedClass.getClassLoader(),
annotation.iconImage(),
annotation.image(),
ConstUi.LARGE_ICON_SIZE,
ConstUi.LARGE_ICON_SIZE));
}
@@ -89,7 +89,7 @@ public boolean editMetadata() {
//
List<GuiAction> actions = new ArrayList<>();
for ( final String name : names ) {
GuiAction action = new GuiAction( name, GuiActionType.Modify, name, name + " : " + hopMetadata.description(), hopMetadata.iconImage(),
GuiAction action = new GuiAction( name, GuiActionType.Modify, name, name + " : " + hopMetadata.description(), hopMetadata.image(),
( shiftAction, controlAction, t ) -> editMetadata( name ) );
action.setClassLoader( getClassLoader() );
actions.add( action );
@@ -118,7 +118,7 @@ public boolean deleteMetadata() {
//
List<GuiAction> actions = new ArrayList<>();
for ( final String name : names ) {
GuiAction action = new GuiAction( name, GuiActionType.Delete, name, name + " : " + hopMetadata.description(), hopMetadata.iconImage(),
GuiAction action = new GuiAction( name, GuiActionType.Delete, name, name + " : " + hopMetadata.description(), hopMetadata.image(),
( shiftAction, controlAction, t ) -> deleteMetadata( name ) );
action.setClassLoader( getClassLoader() );
actions.add( action );
@@ -124,7 +124,7 @@ public MetaSelectionLine( IVariables variables, IHopMetadataProvider metadataPro
wLabel.requestLayout(); // Avoid GTK error in log

HopMetadata hopMetadata = HopMetadataUtil.getHopMetadataAnnotation( managedClass );
Image image = SwtSvgImageUtil.getImage( getDisplay(), managedClass.getClassLoader(), hopMetadata.iconImage(), ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE );
Image image = SwtSvgImageUtil.getImage( getDisplay(), managedClass.getClassLoader(), hopMetadata.image(), ConstUi.SMALL_ICON_SIZE, ConstUi.SMALL_ICON_SIZE );

final Menu menu = new Menu (getShell(), SWT.POP_UP);

@@ -69,7 +69,7 @@ public MetadataContextHandler( HopGui hopGui, IHopMetadataProvider metadataProvi
GuiActionType.Create,
hopMetadata.name(),
"Creates a new " + hopMetadata.name() + " : " + hopMetadata.description(),
hopMetadata.iconImage(),
hopMetadata.image(),
( shiftClicked, controlClicked, parameters ) -> metadataManager.newMetadataWithEditor() );
newAction.setClassLoader( metadataObjectClass.getClassLoader() );
newAction.setCategory( "Metadata" );
@@ -81,7 +81,7 @@ public MetadataContextHandler( HopGui hopGui, IHopMetadataProvider metadataProvi
GuiActionType.Modify,
hopMetadata.name(),
"Edits a " + hopMetadata.name() + " : " + hopMetadata.description(),
hopMetadata.iconImage(),
hopMetadata.image(),
( shiftClicked, controlClicked, parameters ) -> metadataManager.editMetadata() );
editAction.setClassLoader( metadataObjectClass.getClassLoader() );
editAction.setCategory( "Metadata" );
@@ -93,7 +93,7 @@ public MetadataContextHandler( HopGui hopGui, IHopMetadataProvider metadataProvi
GuiActionType.Delete,
hopMetadata.name(),
"After confirmation this deletes a " + hopMetadata.name() + " : " + hopMetadata.description(),
hopMetadata.iconImage(),
hopMetadata.image(),
( shiftClicked, controlClicked, parameters ) -> metadataManager.deleteMetadata() );
deleteAction.setClassLoader( metadataObjectClass.getClassLoader() );
deleteAction.setCategory( "Metadata" );
@@ -413,7 +413,7 @@ public void refreshTree() {
SwtSvgImageUtil.getImage(
shell.getDisplay(),
metadataClass.getClassLoader(),
hopMetadata.iconImage(),
hopMetadata.image(),
ConstUi.ICON_SIZE,
ConstUi.ICON_SIZE);

@@ -711,7 +711,7 @@ public void refresh() {
Image image =
GuiResource.getInstance()
.getImage(
annotation.iconImage(),
annotation.image(),
metadataClass.getClassLoader(),
ConstUi.SMALL_ICON_SIZE,
ConstUi.SMALL_ICON_SIZE);

0 comments on commit db9b484

Please sign in to comment.