Add info icons to config screens
For each parameter on the config screens add an info icon with a
tooltip that explains the parameter.
The info icon is taken from the Tango Icon Library [1].
[1] http://tango.freedesktop.org/Tango_Icon_Library
Change-Id: I817a55c08931f5817bd2567171e5fbd2489c1da7
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagareConfigScreen.java b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagareConfigScreen.java
index 89f8eb8..99cb6fe 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagareConfigScreen.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagareConfigScreen.java
@@ -21,6 +21,7 @@
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;
@@ -52,7 +53,11 @@
protected void display(ConfigInfo info) {
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("imagare-label-panel");
- p.add(new Label("Project:"));
+ p.add(new Label("Project"));
+ Image projectInfo = new Image(ImagarePlugin.RESOURCES.info());
+ projectInfo.setTitle("The default project for the image upload.");
+ p.add(projectInfo);
+ p.add(new Label(":"));
projectBox = new TextBox();
projectBox.setValue(info.getDefaultProject());
p.add(projectBox);
@@ -60,7 +65,14 @@
p = new HorizontalPanel();
p.setStyleName("imagare-label-panel");
- p.add(new Label("Link Decoration:"));
+ p.add(new Label("Link Decoration"));
+ Image linkDecorationInfo = new Image(ImagarePlugin.RESOURCES.info());
+ linkDecorationInfo.setTitle("Decoration for image links in the Gerrit WebUI."
+ + " 'NONE': no decoration, 'TOOLTIP': the image is shown as tooltip on"
+ + " mouse over an image link, 'INLINE': the image is inlined instead of"
+ + " the URL.");
+ p.add(linkDecorationInfo);
+ p.add(new Label(":"));
linkDecorationBox = new ListBox();
int i = 0;
for (LinkDecoration v : LinkDecoration.values()) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagarePlugin.java b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagarePlugin.java
index f9ad27c..b189ebe 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagarePlugin.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/ImagarePlugin.java
@@ -16,10 +16,10 @@
import com.google.gerrit.plugin.client.Plugin;
import com.google.gerrit.plugin.client.PluginEntryPoint;
-
-import com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen;
+import com.google.gwt.core.client.GWT;
public class ImagarePlugin extends PluginEntryPoint {
+ public static final Resources RESOURCES = GWT.create(Resources.class);
@Override
public void onPluginLoad() {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/Resources.java b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/Resources.java
new file mode 100644
index 0000000..da2ac9a
--- /dev/null
+++ b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/Resources.java
@@ -0,0 +1,24 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.googlesource.gerrit.plugins.imagare.client;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface Resources extends ClientBundle {
+
+ @Source("info.png")
+ public ImageResource info();
+}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/imagare/client/info.png b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/info.png
new file mode 100644
index 0000000..8851b99
--- /dev/null
+++ b/src/main/java/com/googlesource/gerrit/plugins/imagare/client/info.png
Binary files differ