From: Patrick Plitzner
Date: Mon, 29 Jun 2015 14:01:34 +0000 (+0200)
Subject: Add icon for switching to advanced media view
X-Git-Tag: 3.7.0~1^2~29
X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/12f71b097551e2a7260bccc0b55530ab9bf90206
Add icon for switching to advanced media view
---
diff --git a/eu.etaxonomy.taxeditor.store/icons/switch_view_type-16x16-32.gif b/eu.etaxonomy.taxeditor.store/icons/switch_view_type-16x16-32.gif
new file mode 100644
index 000000000..c7e0ebd6c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/switch_view_type-16x16-32.gif differ
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
index 51dcd8413..14fa63ae3 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
@@ -134,6 +134,9 @@ public class ImageResources {
/** Constant COLLAPSE_ALL="collapse_all"
*/
public static final String COLLAPSE_ALL = "collapse_all";
+ public static final String SWITCH_VIEW_TYPE = "switch_view_type";
+
+ //derivative icons
public static final String TISSUE_SAMPLE_DERIVATE = "tissue_sample_derivate";
public static final String TISSUE_SAMPLE_DERIVATE_CHARACTER_DATA = "tissue_sample_derivate_character_data";
public static final String DNA_SAMPLE_DERIVATE = "dna_sample_derivate";
@@ -333,6 +336,8 @@ public class ImageResources {
"lock.png");
registerImage(registry, LOCK_OPEN_ICON,
"lock_open.png");
+ registerImage(registry, SWITCH_VIEW_TYPE,
+ "switch_view_type-16x16-32.gif");
registerImage(registry, DNA_SAMPLE_DERIVATE,
"dna_derivate-16x16-32.png");
registerImage(registry, DNA_SAMPLE_DERIVATE_CHARACTER_DATA,
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
index aa51d3605..517e9cfd3 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
@@ -14,6 +14,7 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
@@ -47,8 +48,8 @@ public class MediaMetaElement extends AbstractEntityCollectionElement imp
public void createControls(ICdmFormElement element, int style) {
final IAction switchAction = MediaViewSwitch.createSwitch(MediaMetaElement.this);
Button btnToggleAdvancedMediaView = new Button(getBox(), style);
- btnToggleAdvancedMediaView.setText(switchAction.getText());
btnToggleAdvancedMediaView.setToolTipText(switchAction.getText());
+ btnToggleAdvancedMediaView.setImage(ImageResources.getImage(ImageResources.SWITCH_VIEW_TYPE));
btnToggleAdvancedMediaView.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaViewSwitch.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaViewSwitch.java
index 0506ebfa8..ce598fbad 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaViewSwitch.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaViewSwitch.java
@@ -12,6 +12,8 @@ package eu.etaxonomy.taxeditor.ui.section.media;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+
/**
* Adds a switch to a section with an {@link ITogglableMediaElement}
* to allow switching between simple and advanced media view
@@ -28,7 +30,7 @@ public class MediaViewSwitch {
public static IAction createSwitch(final ITogglableMediaElement togglableMediaElement) {
final String label = "Change View Type";
- Action switchAction = new Action(label, IAction.AS_PUSH_BUTTON) {
+ Action switchAction = new Action(label, ImageResources.getImageDescriptor(ImageResources.SWITCH_VIEW_TYPE)) {
@Override
public void run() {
if(togglableMediaElement!=null){