Simon Hunt

GUI -- Minor refactor of sample UI components (archetypes).

Change-Id: I80c8c699d9aff662bffd4c619f44e2079eddd1ce
......@@ -39,6 +39,9 @@ import java.util.List;
@Component(immediate = true)
public class AppUiComponent {
private static final String VIEW_ID = "sampleCustom";
private static final String VIEW_TEXT = "Sample Custom";
private final Logger log = LoggerFactory.getLogger(getClass());
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
......@@ -46,7 +49,7 @@ public class AppUiComponent {
// List of application views
private final List<UiView> uiViews = ImmutableList.of(
new UiView(UiView.Category.OTHER, "sampleCustom", "Sample Custom")
new UiView(UiView.Category.OTHER, VIEW_ID, VIEW_TEXT)
);
// Factory for UI message handlers
......
......@@ -39,6 +39,9 @@ import java.util.List;
@Component(immediate = true)
public class AppUiTableComponent {
private static final String VIEW_ID = "sampleTable";
private static final String VIEW_TEXT = "Sample Table";
private final Logger log = LoggerFactory.getLogger(getClass());
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
......@@ -46,7 +49,7 @@ public class AppUiTableComponent {
// List of application views
private final List<UiView> uiViews = ImmutableList.of(
new UiView(UiView.Category.OTHER, "sampleTable", "Sample Table")
new UiView(UiView.Category.OTHER, VIEW_ID, VIEW_TEXT)
);
// Factory for UI message handlers
......@@ -58,7 +61,7 @@ public class AppUiTableComponent {
// Application UI extension
protected UiExtension extension =
new UiExtension.Builder(getClass().getClassLoader(), uiViews)
.resourcePath("sampleTable")
.resourcePath(VIEW_ID)
.messageHandlerFactory(messageHandlerFactory)
.build();
......
......@@ -42,6 +42,7 @@ import java.util.List;
public class AppUiTopovComponent {
private static final ClassLoader CL = AppUiTopovComponent.class.getClassLoader();
private static final String VIEW_ID = "sampleTopov";
private final Logger log = LoggerFactory.getLogger(getClass());
......@@ -50,7 +51,7 @@ public class AppUiTopovComponent {
// List of application views
private final List<UiView> uiViews = ImmutableList.of(
new UiViewHidden("sampleTopov")
new UiViewHidden(VIEW_ID)
);
// Factory for UI message handlers
......@@ -68,7 +69,7 @@ public class AppUiTopovComponent {
// Application UI extension
protected UiExtension extension =
new UiExtension.Builder(CL, uiViews)
.resourcePath("sampleTopov")
.resourcePath(VIEW_ID)
.messageHandlerFactory(messageHandlerFactory)
.topoOverlayFactory(topoOverlayFactory)
.build();
......