removed ClientScopeHelper class
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gcube-widgets@144380 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
27ebabce76
commit
f96de8b97e
|
@ -1,31 +0,0 @@
|
||||||
package org.gcube.portlets.user.gcubewidgets.client;
|
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeService;
|
|
||||||
import org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeServiceAsync;
|
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.user.client.Window.Location;
|
|
||||||
@Deprecated
|
|
||||||
public class ClientScopeHelper {
|
|
||||||
public static ScopeServiceAsync getService() {
|
|
||||||
return GWT.create(ScopeService.class);
|
|
||||||
//Window.Location.getHref();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String extractOrgFriendlyURL(String portalURL) {
|
|
||||||
String groupRegEx = "/group/";
|
|
||||||
if (portalURL.contains(groupRegEx)) {
|
|
||||||
String[] splits = portalURL.split(groupRegEx);
|
|
||||||
String friendlyURL = splits[1];
|
|
||||||
if (friendlyURL.contains("/")) {
|
|
||||||
friendlyURL = friendlyURL.split("/")[0];
|
|
||||||
} else {
|
|
||||||
friendlyURL = friendlyURL.split("\\?")[0].split("\\#")[0];
|
|
||||||
}
|
|
||||||
return "/"+friendlyURL;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -29,113 +29,7 @@ public class WidgetFactory implements EntryPoint {
|
||||||
//showSample2();
|
//showSample2();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showSample2() {
|
|
||||||
ClientScopeHelper.getService().setScope(Location.getHref(), new AsyncCallback<Boolean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Boolean result) {
|
|
||||||
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showSample() {
|
|
||||||
|
|
||||||
//
|
|
||||||
PushButton button = new PushButton("Click me");
|
|
||||||
|
|
||||||
|
|
||||||
PushButton button2 = new PushButton("Click me");
|
|
||||||
button2.setEnabled(false);
|
|
||||||
button.setWidth("100px");
|
|
||||||
button2.setWidth("100px");
|
|
||||||
Image img = new Image();
|
|
||||||
// or we can set an id on a specific element for styling
|
|
||||||
img.getElement().setId("pc-template-img");
|
|
||||||
|
|
||||||
// GCubeFrame mainLayout = new GCubeFrame( "My Header Caption", "http://myporlet-usersguide-url");
|
|
||||||
GCubePanel vPanel = new GCubePanel("http://myporlet-usersguide-url");
|
|
||||||
|
|
||||||
|
|
||||||
vPanel.addHeaderWidget(new Button("Button"));
|
|
||||||
vPanel.addHeaderWidget(new Button("Button2"));
|
|
||||||
|
|
||||||
// Create the File menu bar
|
|
||||||
MenuBar menuBar = new MenuBar();
|
|
||||||
menuBar.setAutoOpen(false);
|
|
||||||
menuBar.setWidth("100px");
|
|
||||||
menuBar.setAnimationEnabled(true);
|
|
||||||
menuBar.addSeparator();
|
|
||||||
// menuBar.addItem(getOptionsMenu());
|
|
||||||
vPanel.addHeaderWidget(menuBar);
|
|
||||||
|
|
||||||
vPanel.setSize("505", "50%");
|
|
||||||
vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
|
|
||||||
|
|
||||||
|
|
||||||
vPanel.add(img);
|
|
||||||
vPanel.add(button);
|
|
||||||
vPanel.add(button2);
|
|
||||||
RootPanel.get().add(vPanel);
|
|
||||||
|
|
||||||
// Create the dialog box
|
|
||||||
final GCubeDialog dialogBox = new GCubeDialog();
|
|
||||||
dialogBox.setText("Welcome to GWT!");
|
|
||||||
dialogBox.setAnimationEnabled(true);
|
|
||||||
Button closeButton = new Button("close");
|
|
||||||
VerticalPanel dialogVPanel = new VerticalPanel();
|
|
||||||
dialogVPanel.setWidth("100%");
|
|
||||||
dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
|
|
||||||
dialogVPanel.add(new HTML("Lorem ipsum .....sine sfjsahf jwef apweFH "));
|
|
||||||
dialogVPanel.add(closeButton);
|
|
||||||
//
|
|
||||||
closeButton.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
dialogBox.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set the contents of the Widget
|
|
||||||
dialogBox.setWidget(dialogVPanel);
|
|
||||||
dialogBox.center();
|
|
||||||
dialogBox.show();
|
|
||||||
button.addClickHandler(new ClickHandler() {
|
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
dialogBox.center();
|
|
||||||
dialogBox.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private MenuItem getOptionsMenu() {
|
|
||||||
Command openPageProperties = new Command() {
|
|
||||||
public void execute() {
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Command openHelp = new Command() {
|
|
||||||
public void execute() {
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Create the Options menu
|
|
||||||
MenuBar optionsMenu = new MenuBar(true);
|
|
||||||
|
|
||||||
optionsMenu.setAnimationEnabled(true);
|
|
||||||
MenuItem toReturn = new MenuItem("Menu", optionsMenu);
|
|
||||||
optionsMenu.addItem("Menu item first", openPageProperties);
|
|
||||||
optionsMenu.addItem("Menu item second", openPageProperties);
|
|
||||||
//optionsMenu.addItem(optionPDF);
|
|
||||||
optionsMenu.addItem("Menu item thrid", openPageProperties);
|
|
||||||
optionsMenu.addItem("....", openHelp);
|
|
||||||
return toReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// *
|
// *
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
package org.gcube.portlets.user.gcubewidgets.client.rpc;
|
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteService;
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The client side stub for the RPC service.
|
|
||||||
*/
|
|
||||||
@RemoteServiceRelativePath("scopeService")
|
|
||||||
public interface ScopeService extends RemoteService {
|
|
||||||
boolean setScope(String portalURL);
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package org.gcube.portlets.user.gcubewidgets.client.rpc;
|
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The async counterpart of <code>ScopeService</code>.
|
|
||||||
*/
|
|
||||||
public interface ScopeServiceAsync {
|
|
||||||
|
|
||||||
void setScope(String portalURL, AsyncCallback<Boolean> callback);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue