Skip to content

Commit 9f1969e

Browse files
authored
Merge pull request #5041 from hansva/5040
Add option to make toolbar COMBO read-only, fixes #5040
2 parents 64f3663 + f45242a commit 9f1969e

File tree

7 files changed

+55
-459
lines changed

7 files changed

+55
-459
lines changed

assemblies/debug/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@
444444
<version>${project.version}</version>
445445
<scope>provided</scope>
446446
</dependency>
447+
<dependency>
448+
<groupId>org.apache.hop</groupId>
449+
<artifactId>hop-transform-getvariable</artifactId>
450+
<version>${project.version}</version>
451+
<scope>provided</scope>
452+
</dependency>
447453
<dependency>
448454
<groupId>org.apache.hop</groupId>
449455
<artifactId>hop-transform-pipelineexecutor</artifactId>

core/src/main/java/org/apache/hop/core/gui/plugin/GuiRegistry.java

Lines changed: 4 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import java.util.List;
2727
import java.util.Map;
2828
import java.util.Set;
29+
import lombok.Getter;
30+
import lombok.Setter;
2931
import org.apache.commons.lang.StringUtils;
3032
import org.apache.hop.core.action.GuiContextAction;
3133
import org.apache.hop.core.action.GuiContextActionFilter;
@@ -52,6 +54,8 @@
5254
* then add menu items into it wherever they like. This registry keeps track of everything so that
5355
* menus can be built dynamically as needed.
5456
*/
57+
@Setter
58+
@Getter
5559
public class GuiRegistry {
5660

5761
private static GuiRegistry guiRegistry;
@@ -65,7 +69,6 @@ public class GuiRegistry {
6569

6670
private Map<String, Map<String, GuiToolbarItem>> guiToolbarMap;
6771
private Map<String, List<GuiToolbarItemFilter>> toolbarItemFiltersMap;
68-
6972
private Map<String, Map<String, GuiElements>> dataElementsMap;
7073
private Map<String, List<KeyboardShortcut>> shortCutsMap;
7174
private Map<String, List<GuiAction>> contextActionsMap;
@@ -470,10 +473,6 @@ public void sortAllElements() {
470473
}
471474
}
472475

473-
public Map<String, List<GuiTabItem>> getGuiTabsMap() {
474-
return guiTabsMap;
475-
}
476-
477476
public List<GuiTabItem> findGuiTabItems(String parent) {
478477
return guiTabsMap.get(parent);
479478
}
@@ -674,155 +673,4 @@ public void addGuiActionFilter(
674673
public List<GuiActionFilter> getGuiContextActionFilters(String parentContextId) {
675674
return contextActionFiltersMap.get(parentContextId);
676675
}
677-
678-
/**
679-
* Gets dataElementsMap
680-
*
681-
* @return value of dataElementsMap
682-
*/
683-
public Map<String, Map<String, GuiElements>> getDataElementsMap() {
684-
return dataElementsMap;
685-
}
686-
687-
/**
688-
* @param dataElementsMap The dataElementsMap to set
689-
*/
690-
public void setDataElementsMap(Map<String, Map<String, GuiElements>> dataElementsMap) {
691-
this.dataElementsMap = dataElementsMap;
692-
}
693-
694-
/**
695-
* Gets shortCutsMap
696-
*
697-
* @return value of shortCutsMap
698-
*/
699-
public Map<String, List<KeyboardShortcut>> getShortCutsMap() {
700-
return shortCutsMap;
701-
}
702-
703-
/**
704-
* @param shortCutsMap The shortCutsMap to set
705-
*/
706-
public void setShortCutsMap(Map<String, List<KeyboardShortcut>> shortCutsMap) {
707-
this.shortCutsMap = shortCutsMap;
708-
}
709-
710-
/**
711-
* Gets contextActionsMap
712-
*
713-
* @return value of contextActionsMap
714-
*/
715-
public Map<String, List<GuiAction>> getContextActionsMap() {
716-
return contextActionsMap;
717-
}
718-
719-
/**
720-
* @param contextActionsMap The contextActionsMap to set
721-
*/
722-
public void setContextActionsMap(Map<String, List<GuiAction>> contextActionsMap) {
723-
this.contextActionsMap = contextActionsMap;
724-
}
725-
726-
/**
727-
* Gets guiMenuMap
728-
*
729-
* @return value of guiMenuMap
730-
*/
731-
public Map<String, Map<String, GuiMenuItem>> getGuiMenuMap() {
732-
return guiMenuMap;
733-
}
734-
735-
/**
736-
* @param guiMenuMap The guiMenuMap to set
737-
*/
738-
public void setGuiMenuMap(Map<String, Map<String, GuiMenuItem>> guiMenuMap) {
739-
this.guiMenuMap = guiMenuMap;
740-
}
741-
742-
/**
743-
* Gets guiToolbarMap
744-
*
745-
* @return value of guiToolbarMap
746-
*/
747-
public Map<String, Map<String, GuiToolbarItem>> getGuiToolbarMap() {
748-
return guiToolbarMap;
749-
}
750-
751-
/**
752-
* @param guiToolbarMap The guiToolbarMap to set
753-
*/
754-
public void setGuiToolbarMap(Map<String, Map<String, GuiToolbarItem>> guiToolbarMap) {
755-
this.guiToolbarMap = guiToolbarMap;
756-
}
757-
758-
/**
759-
* Gets guiPluginObjectsMap
760-
*
761-
* @return value of guiPluginObjectsMap
762-
*/
763-
public Map<String, Map<String, Map<String, Object>>> getGuiPluginObjectsMap() {
764-
return guiPluginObjectsMap;
765-
}
766-
767-
/**
768-
* @param guiPluginObjectsMap The guiPluginObjectsMap to set
769-
*/
770-
public void setGuiPluginObjectsMap(
771-
Map<String, Map<String, Map<String, Object>>> guiPluginObjectsMap) {
772-
this.guiPluginObjectsMap = guiPluginObjectsMap;
773-
}
774-
775-
/**
776-
* Gets contextActionFiltersMap
777-
*
778-
* @return value of contextActionFiltersMap
779-
*/
780-
public Map<String, List<GuiActionFilter>> getContextActionFiltersMap() {
781-
return contextActionFiltersMap;
782-
}
783-
784-
/**
785-
* @param contextActionFiltersMap The contextActionFiltersMap to set
786-
*/
787-
public void setContextActionFiltersMap(
788-
Map<String, List<GuiActionFilter>> contextActionFiltersMap) {
789-
this.contextActionFiltersMap = contextActionFiltersMap;
790-
}
791-
792-
/**
793-
* Gets compositeGuiElements
794-
*
795-
* @return value of compositeGuiElements
796-
*/
797-
public Map<String, List<GuiElements>> getCompositeGuiElements() {
798-
return compositeGuiElements;
799-
}
800-
801-
/**
802-
* Sets compositeGuiElements
803-
*
804-
* @param compositeGuiElements value of compositeGuiElements
805-
*/
806-
public void setCompositeGuiElements(Map<String, List<GuiElements>> compositeGuiElements) {
807-
this.compositeGuiElements = compositeGuiElements;
808-
}
809-
810-
/**
811-
* Gets toolbarItemFiltersMap
812-
*
813-
* @return value of toolbarItemFiltersMap
814-
*/
815-
public Map<String, List<GuiToolbarItemFilter>> getToolbarItemFiltersMap() {
816-
return toolbarItemFiltersMap;
817-
}
818-
819-
/**
820-
* Sets toolbarItemFiltersMap
821-
*
822-
* @param toolbarItemFiltersMap value of toolbarItemFiltersMap
823-
*/
824-
public void setToolbarItemFiltersMap(
825-
Map<String, List<GuiToolbarItemFilter>> toolbarItemFiltersMap) {
826-
this.toolbarItemFiltersMap = toolbarItemFiltersMap;
827-
}
828676
}

core/src/main/java/org/apache/hop/core/gui/plugin/toolbar/GuiToolbarElement.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,17 @@
127127
/**
128128
* The text alignment of label or combo widgets
129129
*
130-
* @return
130+
* @return If the text alignment should be right
131131
*/
132132
boolean alignRight() default false;
133+
134+
/**
135+
* Set the Element as read-only
136+
*
137+
* <p>Currently, this only works for COMBO
138+
*
139+
* @see GuiToolbarElementType#COMBO
140+
* @return if the widget should be read-only
141+
*/
142+
boolean readOnly() default false;
133143
}

0 commit comments

Comments
 (0)