Remove hardcoded label identifier.
authorŁukasz Dywicki <ldywicki@apache.org>
Tue, 3 Jan 2012 23:49:25 +0000 (23:49 +0000)
committerŁukasz Dywicki <ldywicki@apache.org>
Tue, 3 Jan 2012 23:49:25 +0000 (23:49 +0000)
Signed-off-by: Lukasz Dywicki <luke@code-house.org>
git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1226997 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
camel/src/main/java/org/apache/karaf/webconsole/camel/internal/context/ContextActionsPanel.java
core/src/main/java/org/apache/karaf/webconsole/core/brand/DefaultBrandProvider.java
core/src/main/java/org/apache/karaf/webconsole/core/table/ActionsPanel.java
cxf/src/main/java/org/apache/karaf/webconsole/cxf/internal/services/CxfBusesActionPanel.java
karaf/admin/src/main/java/org/apache/karaf/webconsole/karaf/admin/list/InstanceActionsPanel.java
karaf/features/src/main/java/org/apache/karaf/webconsole/karaf/features/feature/FeaturesActionsPanel.java
karaf/features/src/main/java/org/apache/karaf/webconsole/karaf/features/repository/RepositoriesActionPanel.java
karaf/features/src/main/java/org/apache/karaf/webconsole/karaf/features/repository/RepositoriesPage.java
osgi/blueprint/src/main/java/org/apache/karaf/webconsole/osgi/blueprint/view/BlueprintActionsPanel.java
osgi/bundle/src/main/java/org/apache/karaf/webconsole/osgi/bundle/internal/view/BundleActionsPanel.java
osgi/config/src/main/java/org/apache/karaf/webconsole/osgi/config/view/ConfigurationsActionPanel.java
servicemix/src/main/java/org/apache/karaf/webconsole/servicemix/internal/ExchangeActionsPanel.java

index 9351ea4..8f2d043 100644 (file)
@@ -22,11 +22,11 @@ public class ContextActionsPanel extends ActionsPanel<CamelContext> {
     }
 
     @Override
-    protected List<Link> getLinks(CamelContext object, String id) {
+    protected List<Link> getLinks(CamelContext object, String linkId, String labelId) {
         List<Link> links = new ArrayList<Link>();
 
         if (!object.isTracing()) {
-            Link link = new Link<CamelContext>(id) {
+            Link link = new Link<CamelContext>(linkId) {
                 @Override
                 public void onClick() {
                     CamelContext context = (CamelContext) ContextActionsPanel.this.getDefaultModelObject();
@@ -35,10 +35,10 @@ public class ContextActionsPanel extends ActionsPanel<CamelContext> {
                     Session.get().info("Tracing enabled for context " + context.getName());
                 }
             };
-            link.add(new Label("label", "Enable tracing"));
+            link.add(new Label(labelId, "Enable tracing"));
             links.add(link);
         } else {
-            Link link = new Link<CamelContext>(id) {
+            Link link = new Link<CamelContext>(linkId) {
                 @Override
                 public void onClick() {
                     CamelContext context = (CamelContext) ContextActionsPanel.this.getDefaultModelObject();
@@ -47,19 +47,19 @@ public class ContextActionsPanel extends ActionsPanel<CamelContext> {
                     Session.get().info("Tracing disabled for context " + context.getName());
                 }
             };
-            link.add(new Label("label", "Disable tracing"));
+            link.add(new Label(labelId, "Disable tracing"));
             links.add(link);
         }
 
         if (container.isTracePossible(object)) {
-            Link link = new Link<CamelContext>(id) {
+            Link link = new Link<CamelContext>(linkId) {
                 @Override
                 public void onClick() {
                     CamelContext context = (CamelContext) ContextActionsPanel.this.getDefaultModelObject();
                     setResponsePage(new DumpPage(container, context));
                 }
             };
-            link.add(new Label("label", "View messages"));
+            link.add(new Label(labelId, "View messages"));
             links.add(link);
         }
 
index 96cc71c..5c05c70 100644 (file)
@@ -22,6 +22,7 @@ import java.util.List;
 
 import org.apache.karaf.webconsole.core.BasePage;
 import org.apache.karaf.webconsole.core.behavior.FormalizeBehavior;
+import org.apache.karaf.webconsole.core.behavior.JQueryUiThemeBehavior;
 import org.apache.wicket.Page;
 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.behavior.IBehavior;
@@ -45,6 +46,7 @@ public class DefaultBrandProvider implements BrandProvider, Serializable /* for
 
     public void modify(Page page) {
         page.add(new FormalizeBehavior());
+        page.add(new JQueryUiThemeBehavior());
     }
 
 }
index 7cd9cc8..0e613f9 100644 (file)
@@ -39,7 +39,7 @@ public class ActionsPanel<T> extends Panel {
 
         add(CSSPackageResource.getHeaderContribution(ActionsPanel.class, "actions.css"));
 
-        final List<Link> links = getLinks(model.getObject(), "action");
+        final List<Link> links = getLinks(model.getObject(), "action", "label");
         add(new ListView<Link>("actions", new ListModel<Link>(links)) {
             @Override
             protected void populateItem(ListItem<Link> item) {
@@ -56,7 +56,7 @@ public class ActionsPanel<T> extends Panel {
         });
     }
 
-    protected List<Link> getLinks(T object, String id) {
+    protected List<Link> getLinks(T object, String linkId, String labelId) {
         return Collections.emptyList();
     }
 
index c77c7f3..b9088f4 100644 (file)
@@ -18,14 +18,14 @@ public class CxfBusesActionPanel extends ActionsPanel<Bus> {
     }
 
     @Override
-    protected List<Link> getLinks(Bus object, String id) {
+    protected List<Link> getLinks(Bus object, String linkId, String labelId) {
         List<Link> links = new ArrayList<Link>();
 
         PageParameters params = new PageParameters();
         params.put("busId", object.getId());
 
-        Link link = new BookmarkablePageLink<DetailsPage>(id, DetailsPage.class, params);
-        link.add(new Label("label", "Details"));
+        Link link = new BookmarkablePageLink<DetailsPage>(linkId, DetailsPage.class, params);
+        link.add(new Label(labelId, "Details"));
         links.add(link);
 
         return links;
index d466b0e..807819f 100644 (file)
@@ -17,14 +17,14 @@ public class InstanceActionsPanel extends ActionsPanel<Instance> {
     }
 
     @Override
-    protected List<Link> getLinks(Instance object, String id) {
+    protected List<Link> getLinks(Instance object, String linkId, final String labelId) {
         List<Link> links = new ArrayList<Link>();
 
         try {
             if (Instance.STOPPED.equals(object.getState())) {
-                links.add(new Link(id) {
+                links.add(new Link(linkId) {
                     {
-                        add(new Label("label", "Start"));
+                        add(new Label(labelId, "Start"));
                     }
                     @Override
                     public void onClick() {
@@ -38,9 +38,9 @@ public class InstanceActionsPanel extends ActionsPanel<Instance> {
                     }
                 });
             } else {
-                links.add(new Link(id) {
+                links.add(new Link(linkId) {
                     {
-                        add(new Label("label", "Stop"));
+                        add(new Label(labelId, "Stop"));
                     }
                     @Override
                     public void onClick() {
@@ -58,9 +58,9 @@ public class InstanceActionsPanel extends ActionsPanel<Instance> {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
-        links.add(new Link(id) {
+        links.add(new Link(linkId) {
             {
-                add(new Label("label", "Destroy"));
+                add(new Label(labelId, "Destroy"));
             }
             @Override
             public void onClick() {
index e5fa414..0b175ab 100644 (file)
@@ -38,8 +38,8 @@ public class FeaturesActionsPanel extends ActionsPanel<Feature> {
     }
 
     @Override
-    protected List<Link> getLinks(Feature object, String id) {
-        Link link = new Link(id) {
+    protected List<Link> getLinks(Feature object, String linkId, String labelId) {
+        Link link = new Link(linkId) {
 
             @Override
             public void onClick() {
@@ -58,7 +58,7 @@ public class FeaturesActionsPanel extends ActionsPanel<Feature> {
         };
 
         link.add(new SimpleAttributeModifier("class", isInstalled(object) ? "installed" : "uninstalled"));
-        link.add(new Label("label"));
+        link.add(new Label(labelId));
 
         // add image to the link
         return Arrays.asList(link);
index ccbd00f..66440f8 100644 (file)
@@ -38,10 +38,10 @@ public class RepositoriesActionPanel extends ActionsPanel<Repository> {
     }
 
     @Override
-    protected List<Link> getLinks(Repository object, String id) {
+    protected List<Link> getLinks(Repository object, String linkId, String labelId) {
         List<Link> links = new ArrayList<Link>();
 
-        Link remove = new Link(id) {
+        Link remove = new Link(linkId) {
             @Override
             public void onClick() {
                 Repository object = (Repository) RepositoriesActionPanel.this.getDefaultModelObject();
@@ -51,7 +51,7 @@ public class RepositoriesActionPanel extends ActionsPanel<Repository> {
                 Session.get().info("Repository " + object.getURI() + " was removed");
             }
         };
-        remove.add(new Label("label", "Remove"));
+        remove.add(new Label(labelId, "Remove"));
 
         links.add(remove);
 
index 970d836..e78dca4 100644 (file)
  */
 package org.apache.karaf.webconsole.karaf.features.repository;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
-import org.apache.karaf.webconsole.core.page.SidebarPage;
 import org.apache.karaf.webconsole.core.table.OrdinalColumn;
 import org.apache.karaf.webconsole.karaf.features.KarafFeaturesPage;
 import org.apache.karaf.webconsole.karaf.features.RepositoriesProvider;
-import org.apache.wicket.Page;
 import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
 import org.apache.wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
@@ -34,7 +28,6 @@ import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColu
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
-import org.ops4j.pax.wicket.api.PaxWicketBean;
 import org.ops4j.pax.wicket.api.PaxWicketMountPoint;
 
 @PaxWicketMountPoint(mountPoint = "/karaf/repositories")
index 086068c..b78262d 100644 (file)
@@ -35,12 +35,12 @@ public class BlueprintActionsPanel extends ActionsPanel<ServiceReference> {
     }
 
     @Override
-    protected List<Link> getLinks(ServiceReference object, String id) {
+    protected List<Link> getLinks(ServiceReference object, String linkId, String labelId) {
         PageParameters params = new PageParameters();
         params.put("bundleId", object.getBundle().getBundleId());
 
-        Link link = new BookmarkablePageLink(id, DetailsPage.class, params);
-        link.add(new Label("label", "View components"));
+        Link link = new BookmarkablePageLink(linkId, DetailsPage.class, params);
+        link.add(new Label(labelId, "View components"));
 
         return Arrays.asList(link);
     }
index 2d6295a..d6fa107 100644 (file)
@@ -59,35 +59,35 @@ public class BundleActionsPanel extends ActionsPanel<Bundle> {
     }
 
     @Override
-    protected List<Link> getLinks(Bundle object, String id) {
+    protected List<Link> getLinks(Bundle object, String linkId, String labelId) {
         PageParameters params = new PageParameters();
         params.put("bundleId", object.getBundleId());
 
         List<Link> links = new ArrayList<Link>();
 
         // details link
-        Link link = new BookmarkablePageLink<DetailsPage>(id, DetailsPage.class, params);
+        Link link = new BookmarkablePageLink<DetailsPage>(linkId, DetailsPage.class, params);
         link.add(new Label("label", "Details"));
 
         links.add(link);
 
         switch (State.of(object.getState())) {
         case ACTIVE:
-            links.add(createStopLink(id));
+            links.add(createStopLink(linkId, labelId));
             break;
         case INSTALLED:
         case RESOLVED:
-            links.add(createStartLink(id));
+            links.add(createStartLink(linkId, labelId));
         }
 
-        links.add(createRefreshLink(id));
-        links.add(createUninstallLink(id));
+        links.add(createRefreshLink(linkId, labelId));
+        links.add(createUninstallLink(linkId, labelId));
 
         return links;
     }
 
-    private Link createUninstallLink(String id) {
-        Link link = new Link(id) {
+    private Link createUninstallLink(String linkId, String labelId) {
+        Link link = new Link(linkId) {
             @Override
             public void onClick() {
                 Bundle bundle = (Bundle) BundleActionsPanel.this.getDefaultModelObject();
@@ -104,12 +104,12 @@ public class BundleActionsPanel extends ActionsPanel<Bundle> {
             }
             
         };
-        link.add(new Label("label", "Uninstall"));
+        link.add(new Label(labelId, "Uninstall"));
         return link;
     }
 
-    private Link createRefreshLink(String id) {
-        Link link = new Link(id) {
+    private Link createRefreshLink(String linkId, String labelId) {
+        Link link = new Link(linkId) {
             @Override
             public void onClick() {
                 Bundle bundle = (Bundle) BundleActionsPanel.this.getDefaultModelObject();
@@ -120,12 +120,12 @@ public class BundleActionsPanel extends ActionsPanel<Bundle> {
             }
             
         };
-        link.add(new Label("label", "Refresh"));
+        link.add(new Label(labelId, "Refresh"));
         return link;
     }
 
-    private Link createStartLink(String id) {
-        Link link = new Link(id) {
+    private Link createStartLink(String linkId, String labelId) {
+        Link link = new Link(linkId) {
             @Override
             public void onClick() {
                 Bundle bundle = (Bundle) BundleActionsPanel.this.getDefaultModelObject();
@@ -141,12 +141,12 @@ public class BundleActionsPanel extends ActionsPanel<Bundle> {
             }
             
         };
-        link.add(new Label("label", "Start"));
+        link.add(new Label(labelId, "Start"));
         return link;
     }
 
-    private Link createStopLink(String id) {
-        Link link = new Link(id) {
+    private Link createStopLink(String linkId, String labelId) {
+        Link link = new Link(linkId) {
             public void onClick() {
                 Bundle bundle = (Bundle) BundleActionsPanel.this.getDefaultModelObject();
                 try {
@@ -159,7 +159,7 @@ public class BundleActionsPanel extends ActionsPanel<Bundle> {
                 }
             }
         };
-        link.add(new Label("label", "Stop"));
+        link.add(new Label(labelId, "Stop"));
         return link;
     }
 }
index 29fe471..43ca32a 100644 (file)
@@ -38,17 +38,17 @@ class ConfigurationsActionPanel extends ActionsPanel<Configuration> {
     }
 
     @Override
-    protected List<Link> getLinks(Configuration object, String id) {
+    protected List<Link> getLinks(Configuration object, String linkId, String labelId) {
         PageParameters params = new PageParameters();
         params.put("pid", object.getPid());
 
-        Link removeLink = new BookmarkablePageLink<ConfigurationEditPage>(id, ConfigurationRemovePage.class, params);
+        Link removeLink = new BookmarkablePageLink<ConfigurationEditPage>(linkId, ConfigurationRemovePage.class, params);
         removeLink.add(new SimpleAttributeModifier("class", "remove"));
-        removeLink.add(new Label("label", "remove"));
+        removeLink.add(new Label(labelId, "remove"));
 
-        Link editLink = new BookmarkablePageLink<ConfigurationEditPage>(id, ConfigurationEditPage.class, params);
+        Link editLink = new BookmarkablePageLink<ConfigurationEditPage>(linkId, ConfigurationEditPage.class, params);
         removeLink.add(new SimpleAttributeModifier("class", "edit"));
-        editLink.add(new Label("label", "edit"));
+        editLink.add(new Label(labelId, "edit"));
 
         return Arrays.asList(editLink, removeLink);
     }
index c6bca60..6116680 100644 (file)
@@ -36,16 +36,16 @@ public class ExchangeActionsPanel extends ActionsPanel<Exchange> {
     }
 
     @Override
-    protected List<Link> getLinks(final Exchange object, String id) {
+    protected List<Link> getLinks(final Exchange object, String linkId, String labelId) {
         List<Link> links = new ArrayList<Link>();
 
-        Link link = new Link(id) {
+        Link link = new Link(linkId) {
             @Override
             public void onClick() {
                 RequestCycle.get().setResponsePage(new DetailsPage(object));
             }
         };
-        link.add(new Label("label", "Details"));
+        link.add(new Label(labelId, "Details"));
 
         links.add(link);