Skip to content

Commit

Permalink
HOP-2283 Rename annotation HopMetadata.iconImage > image
Browse files Browse the repository at this point in the history
  • Loading branch information
nadment committed Dec 11, 2020
1 parent e8eedbd commit 92388ab
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@

String description() default "";

String iconImage() default "ui/images/folder.svg";
String image() default "ui/images/folder.svg";
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected String extractName( HopMetadata annotation ) {

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion engine/src/main/java/org/apache/hop/server/HopServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand 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" );
Expand All @@ -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" );
Expand All @@ -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" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public void refreshTree() {
SwtSvgImageUtil.getImage(
shell.getDisplay(),
metadataClass.getClassLoader(),
hopMetadata.iconImage(),
hopMetadata.image(),
ConstUi.ICON_SIZE,
ConstUi.ICON_SIZE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public void refresh() {
Image image =
GuiResource.getInstance()
.getImage(
annotation.iconImage(),
annotation.image(),
metadataClass.getClassLoader(),
ConstUi.SMALL_ICON_SIZE,
ConstUi.SMALL_ICON_SIZE);
Expand Down

0 comments on commit 92388ab

Please sign in to comment.