refs 5258: Add link to help on Dataminer
https://support.d4science.org/issues/5258 Added Help button on menu git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@132466 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f1e5e0461b
commit
07a3f4270c
|
@ -7,10 +7,15 @@ import org.gcube.portlets.user.dataminermanager.client.common.EventBusProvider;
|
|||
import org.gcube.portlets.user.dataminermanager.client.events.MenuEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.events.MenuSwitchEvent;
|
||||
import org.gcube.portlets.user.dataminermanager.client.type.MenuType;
|
||||
import org.gcube.portlets.user.dataminermanager.client.util.UtilsGXT3;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.resources.client.ResourceCallback;
|
||||
import com.google.gwt.resources.client.ResourceException;
|
||||
import com.google.gwt.resources.client.TextResource;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
|
||||
|
@ -22,7 +27,7 @@ import com.google.gwt.user.client.ui.Image;
|
|||
*/
|
||||
public class Header extends HorizontalPanel {
|
||||
|
||||
private Image menuGoBack, menuExperiment, menuDataSpace, menuComputations;
|
||||
private Image menuGoBack, menuExperiment, menuDataSpace, menuComputations, menuHelp;
|
||||
private Enum<MenuType> currentSelection;
|
||||
|
||||
public Header() {
|
||||
|
@ -98,23 +103,40 @@ public class Header extends HorizontalPanel {
|
|||
EventBusProvider.INSTANCE.fireEvent(menuEvent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
menuHelp = new Image(
|
||||
DataMinerManager.resources.menuItemHelp());
|
||||
menuHelp.addStyleName("menuItemImage");
|
||||
menuHelp.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Log.debug("Click Menu Help");
|
||||
showHelp();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
add(logo);
|
||||
add(menuGoBack);
|
||||
add(menuDataSpace);
|
||||
add(menuExperiment);
|
||||
add(menuComputations);
|
||||
add(menuHelp);
|
||||
|
||||
this.setCellWidth(logo, "100px");
|
||||
this.setCellWidth(menuGoBack, "100px");
|
||||
this.setCellWidth(menuDataSpace, "80px");
|
||||
this.setCellWidth(menuExperiment, "80px"); //
|
||||
this.setCellWidth(menuComputations, "80px");
|
||||
this.setCellWidth(menuHelp, "80px");
|
||||
|
||||
menuGoBack.setVisible(false);
|
||||
menuDataSpace.setVisible(false);
|
||||
menuExperiment.setVisible(false);
|
||||
menuComputations.setVisible(false);
|
||||
menuHelp.setVisible(false);
|
||||
}
|
||||
|
||||
public void setMenu(MenuType menuType){
|
||||
|
@ -125,6 +147,7 @@ public class Header extends HorizontalPanel {
|
|||
menuDataSpace.setVisible(false);
|
||||
menuExperiment.setVisible(false);
|
||||
menuComputations.setVisible(false);
|
||||
menuHelp.setVisible(false);
|
||||
|
||||
if (currentSelection != null
|
||||
&& currentSelection.compareTo(MenuType.EXPERIMENT) == 0)
|
||||
|
@ -143,8 +166,10 @@ public class Header extends HorizontalPanel {
|
|||
menuDataSpace.setVisible(true);
|
||||
menuExperiment.setVisible(true);
|
||||
menuComputations.setVisible(true);
|
||||
menuHelp.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (currentSelection != null
|
||||
&& currentSelection.compareTo(MenuType.EXPERIMENT) == 0)
|
||||
menuExperiment.removeStyleName("menuItemImage-selected");
|
||||
|
@ -176,6 +201,7 @@ public class Header extends HorizontalPanel {
|
|||
menuDataSpace.setVisible(false);
|
||||
menuExperiment.setVisible(false);
|
||||
menuComputations.setVisible(false);
|
||||
menuHelp.setVisible(false);
|
||||
|
||||
if (currentSelection != null
|
||||
&& currentSelection.compareTo(MenuType.EXPERIMENT) == 0)
|
||||
|
@ -194,6 +220,7 @@ public class Header extends HorizontalPanel {
|
|||
menuDataSpace.setVisible(true);
|
||||
menuExperiment.setVisible(true);
|
||||
menuComputations.setVisible(true);
|
||||
menuHelp.setVisible(true);
|
||||
}
|
||||
|
||||
if (currentSelection != null
|
||||
|
@ -216,5 +243,32 @@ public class Header extends HorizontalPanel {
|
|||
currentSelection = event.getMenuType();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
private void showHelp() {
|
||||
try {
|
||||
DataMinerManager.resources.wikiLink().getText(
|
||||
new ResourceCallback<TextResource>() {
|
||||
public void onError(ResourceException e) {
|
||||
Log.error("Error retrieving wiki link!: "
|
||||
+ e.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error",
|
||||
"Error retrieving wiki link!");
|
||||
}
|
||||
|
||||
public void onSuccess(TextResource r) {
|
||||
String s = r.getText();
|
||||
Window.open(s,
|
||||
"DataMiner Wiki", "");
|
||||
}
|
||||
});
|
||||
} catch (ResourceException e) {
|
||||
Log.error("Error retrieving wiki link!: " + e.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error", "Error retrieving wiki link!");
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package org.gcube.portlets.user.dataminermanager.client.resources;
|
||||
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ExternalTextResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ClientBundle.Source;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -11,6 +13,9 @@ import com.google.gwt.resources.client.ImageResource;
|
|||
*/
|
||||
public interface Resources extends ClientBundle {
|
||||
|
||||
@Source("WikiLink.txt")
|
||||
ExternalTextResource wikiLink();
|
||||
|
||||
@Source("logoLittle.png")
|
||||
ImageResource logoLittle();
|
||||
|
||||
|
@ -58,6 +63,9 @@ public interface Resources extends ClientBundle {
|
|||
|
||||
@Source("menuItemDataspace.png")
|
||||
ImageResource menuItemInputspace();
|
||||
|
||||
@Source("menuItemHelp.png")
|
||||
ImageResource menuItemHelp();
|
||||
|
||||
@Source("ajax-loader-big.gif")
|
||||
ImageResource loaderBig();
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
http://wiki.gcube-system.org/gcube/DataMiner_Manager
|
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
Loading…
Reference in New Issue