() {
public void onSuccess(final Void result) {
Commands.showPopup("Empty cache", "The remote cache has been cleaned");
}
public void onFailure(final Throwable caught) {
Commands.showPopup("Empty cache error", "The remote cache has not been cleaned");
}
});
};
};
emptyCache.setIconStyle("clear-icon");
toolsMenu.add(emptyCache);
/***********************************************************
* MENU - ABOUT
**********************************************************/
Menu helpMenu = new Menu();
MenuItem aboutMnuItem = new MenuItem("About") {
@Override
protected void onClick(final ComponentEvent be) {
super.onClick(be);
Dialog dlg = new Dialog();
dlg.setHeading("About - Resource Management");
dlg.addText("
This software is part of the gCube Project.
" +
"Site: http://www.gcube-system.org/" +
"The gCube/gCore software is licensed as Free Open Source software " +
"conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
" +
"The software and documentation is provided by its authors/distributors " +
"\"as is\" and no expressed or " +
"implied warranty is given for its use, quality or fitness for a " +
"particular case.
" +
"" +
"Issues can be submitted here.
" +
"Notice: specify this Component:
Repository Path: /org/gcube/portlets/admin/resource-management
" +
"
This software was built over the gCube Featherweight Stack (FWS) and Google Webtool Kit (GWT) technologies.
" +
"
");
dlg.setClosable(true);
dlg.setModal(true);
dlg.setHideOnButtonClick(true);
dlg.show();
}
};
aboutMnuItem.setIconStyle("about-icon");
helpMenu.add(aboutMnuItem);
MenuBar mb = new MenuBar();
mb.add(new MenuBarItem("Tools", toolsMenu));
mb.add(new MenuBarItem("Options", optionsMenu));
mb.add(new MenuBarItem("Search", searchMenu));
mb.add(new MenuBarItem("Help", helpMenu));
MainPanel menuPanel = WidgetsRegistry.getPanel(UIIdentifiers.GLOBAL_MENU_CONTAINER_PANEL);
WidgetsRegistry.registerWidget(UIIdentifiers.GLOBAL_MENUBAR_ID, mb);
menuPanel.add(mb, true);
}
private void buildStatusBar() {
MainPanel menuPanel = WidgetsRegistry.getPanel(UIIdentifiers.GLOBAL_MENU_CONTAINER_PANEL);
ToolBar statusbar = new ToolBar();
statusbar.add(new SeparatorToolItem());
if (StatusHandler.getStatus().getRunningMode() != RunningMode.PORTAL) {
//Your View Class
final ListStore yourStore = new ListStore(){
@Override
public ContexClientModel findModel(final ContexClientModel model) {
if(model.getId()!=null&&!model.getId().isEmpty()){
for (final ContexClientModel m : all) {
if(model.getId().equals(m.getId())) {
return m;
}
}
}
return null;
}
};
final ComboBox< ContexClientModel > select = new ComboBox< ContexClientModel >();
select.setAllowBlank(false);
select.setStore(yourStore);
select.setDisplayField("name");
select.setValueField("id");
select.setTriggerAction(TriggerAction.ALL);
select.setMaxHeight(500);
select.setWidth("310px");
select.setEmptyText("Available Contexts");
select.addSelectionChangedListener(new SelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent se) {
Commands.doLoadResourceTree(this, se.getSelectedItem().getId());
GWT.log("doLoadResourceTree");
}
});
WidgetsRegistry.registerWidget(UIIdentifiers.BUTTON_AVAILABLE_SCOPES_ID, select);
// Checks that this menu item is permitted to the current user
statusbar.add(new Html(" "));
statusbar.add(select);
} else {
statusbar.add(new Label("Current role: " + StatusHandler.getStatus().getCredentials()));
}
//statusbar.add(new FillToolItem());
statusbar.add(new Label(" "));
ProgressBar progressStatus = new ProgressBar();
progressStatus.setWidth(200);
progressStatus.updateText("Updating Infrastructure...");
statusbar.add(progressStatus);
progressStatus.hide();
WidgetsRegistry.registerWidget(UIIdentifiers.STATUS_PROGRESS_BAR_ID, progressStatus);
statusbar.add(new FillToolItem());
statusbar.add(new Label("Current Scope: "));
Status scopeInfo = new Status();
scopeInfo.setWidth(350);
scopeInfo.setText(Messages.NO_SCOPE_SELECTED);
scopeInfo.setBox(true);
statusbar.add(scopeInfo);
WidgetsRegistry.registerWidget(UIIdentifiers.STATUS_SCOPE_INFO_ID, scopeInfo);
statusbar.add(new Label(" Loaded Resources: "));
Status loadedResources = new Status();
loadedResources.setWidth(35);
loadedResources.setText("0");
loadedResources.setBox(true);
statusbar.add(loadedResources);
WidgetsRegistry.registerWidget(UIIdentifiers.STATUS_LOADED_RESOURCES_ID, loadedResources);
menuPanel.add(statusbar, false);
menuPanel.getContainer().setBorders(false);
menuPanel.getContainer().setShadow(true);
WidgetsRegistry.registerWidget(UIIdentifiers.GLOBAL_STATUS_BAR_ID, statusbar);
}
}