lot of changes in the UI for the VME Case
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@87136 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b082b54aa7
commit
86746daad9
|
@ -52,8 +52,7 @@ public class Headerbar extends Composite{
|
||||||
private static final String EXPORT_HTML = "Export to HTML";
|
private static final String EXPORT_HTML = "Export to HTML";
|
||||||
private static final String EXPORT_FIMES = "Export to FiMES XML";
|
private static final String EXPORT_FIMES = "Export to FiMES XML";
|
||||||
private static final String EXPORT_XML = "Export to XML";
|
private static final String EXPORT_XML = "Export to XML";
|
||||||
private static final String IMPORT_VME = "Open VME Report";
|
private static final String IMPORT_VME = "Edit VME";
|
||||||
private static final String IMPORT_VME_REF = "Import VME Reference Report";
|
|
||||||
// private static final String EXPORT_ENCRYPTED_REPORT = "Save an Encrypted Version to Desktop";
|
// private static final String EXPORT_ENCRYPTED_REPORT = "Save an Encrypted Version to Desktop";
|
||||||
|
|
||||||
private static final String VIEW_USER_COMMENTS = "View user comments";
|
private static final String VIEW_USER_COMMENTS = "View user comments";
|
||||||
|
@ -134,18 +133,14 @@ public class Headerbar extends Composite{
|
||||||
fileMenu = getFileMenu();
|
fileMenu = getFileMenu();
|
||||||
menuBar.addItem(fileMenu);
|
menuBar.addItem(fileMenu);
|
||||||
separator1 = menuBar.addSeparator();
|
separator1 = menuBar.addSeparator();
|
||||||
vmeMenu = getVMEMenu();
|
|
||||||
menuBar.addItem(vmeMenu);
|
|
||||||
|
|
||||||
separator3 = menuBar.addSeparator();
|
|
||||||
viewMenu = getViewMenu();
|
viewMenu = getViewMenu();
|
||||||
menuBar.addItem(viewMenu);
|
menuBar.addItem(viewMenu);
|
||||||
// separator2 = menuBar.addSeparator();
|
separator2 = menuBar.addSeparator();
|
||||||
// sectionsMenu = getSectionMenu();
|
sectionsMenu = getSectionMenu();
|
||||||
// menuBar.addItem(sectionsMenu);
|
menuBar.addItem(sectionsMenu);
|
||||||
|
separator3 = menuBar.addSeparator();
|
||||||
// biblioMenu = getBiblioMenu();
|
biblioMenu = getBiblioMenu();
|
||||||
// menuBar.addItem(biblioMenu);
|
menuBar.addItem(biblioMenu);
|
||||||
separator4 = menuBar.addSeparator();
|
separator4 = menuBar.addSeparator();
|
||||||
exportMenu = getExportsMenu();
|
exportMenu = getExportsMenu();
|
||||||
menuBar.addItem(exportMenu);
|
menuBar.addItem(exportMenu);
|
||||||
|
@ -176,6 +171,34 @@ public class Headerbar extends Composite{
|
||||||
initWidget(mainLayout);
|
initWidget(mainLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setMenuForVME() {
|
||||||
|
menuBar.removeItem(viewMenu);
|
||||||
|
menuBar.removeItem(sectionsMenu);
|
||||||
|
menuBar.removeItem(biblioMenu);
|
||||||
|
menuBar.removeSeparator(separator1);
|
||||||
|
menuBar.removeSeparator(separator2);
|
||||||
|
menuBar.removeSeparator(separator3);
|
||||||
|
menuBar.removeItem(exportMenu);
|
||||||
|
|
||||||
|
vmeMenu = getVMEMenuEdit();
|
||||||
|
menuBar.addItem(vmeMenu);
|
||||||
|
|
||||||
|
menuBar.addSeparator();
|
||||||
|
|
||||||
|
MenuItem vmeMenuCreate = getVMEMenuFake("Create");
|
||||||
|
menuBar.addItem(vmeMenuCreate);
|
||||||
|
|
||||||
|
separator4 = menuBar.addSeparator();
|
||||||
|
|
||||||
|
MenuItem vmeMenuDelete = getVMEMenuFake("Delete");
|
||||||
|
menuBar.addItem(vmeMenuDelete);
|
||||||
|
|
||||||
|
menuBar.addSeparator();
|
||||||
|
exportMenu = getExportsMenu();
|
||||||
|
menuBar.addItem(exportMenu);
|
||||||
|
}
|
||||||
|
|
||||||
public void setMenuForWorkflowDocument(boolean canUpdate) {
|
public void setMenuForWorkflowDocument(boolean canUpdate) {
|
||||||
presenter.setMenuForWorkflowDocument(true);
|
presenter.setMenuForWorkflowDocument(true);
|
||||||
menuBar.removeItem(fileMenu);
|
menuBar.removeItem(fileMenu);
|
||||||
|
@ -309,11 +332,33 @@ public class Headerbar extends Composite{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private MenuItem getVMEMenu() {
|
private MenuItem getVMEMenuFake(String fakeOption) {
|
||||||
|
MenuBar createMenu = new MenuBar(true);
|
||||||
|
|
||||||
|
createMenu.setAnimationEnabled(true);
|
||||||
|
MenuItem toReturn = new MenuItem(fakeOption+" VME-DB", createMenu);
|
||||||
|
toReturn.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
|
||||||
|
|
||||||
|
MenuItem item = new MenuItem("<font color=\"gray\">"+fakeOption+" VME</font>", true, getNullCommand());
|
||||||
|
createMenu.addItem(item);
|
||||||
|
createMenu.addSeparator();
|
||||||
|
|
||||||
|
item = new MenuItem("<font color=\"gray\">"+fakeOption+" VME General Measure</font>", true, getNullCommand());
|
||||||
|
createMenu.addItem(item);
|
||||||
|
item = new MenuItem("<font color=\"gray\">"+fakeOption+" Information Source</font>", true, getNullCommand());
|
||||||
|
createMenu.addItem(item);
|
||||||
|
item = new MenuItem("<font color=\"gray\">"+fakeOption+" Fishing footprint</font>", true, getNullCommand());
|
||||||
|
createMenu.addItem(item);
|
||||||
|
item = new MenuItem("<font color=\"gray\">"+fakeOption+" Regional History of VMEs</font>", true, getNullCommand());
|
||||||
|
createMenu.addItem(item);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MenuItem getVMEMenuEdit() {
|
||||||
MenuBar importMenu = new MenuBar(true);
|
MenuBar importMenu = new MenuBar(true);
|
||||||
|
|
||||||
importMenu.setAnimationEnabled(true);
|
importMenu.setAnimationEnabled(true);
|
||||||
MenuItem toReturn = new MenuItem("Edit VME", importMenu);
|
MenuItem toReturn = new MenuItem("Edit VME-DB", importMenu);
|
||||||
toReturn.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
|
toReturn.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
|
||||||
|
|
||||||
Command importVMEReport = new Command() {
|
Command importVMEReport = new Command() {
|
||||||
|
@ -574,8 +619,8 @@ public class Headerbar extends Composite{
|
||||||
fileMenu.setAnimationEnabled(true);
|
fileMenu.setAnimationEnabled(true);
|
||||||
|
|
||||||
MenuItem toReturn = new MenuItem("File", fileMenu);
|
MenuItem toReturn = new MenuItem("File", fileMenu);
|
||||||
fileMenu.addItem("Open Report", cmd.openReport);
|
fileMenu.addItem("Open Report from Workspace", cmd.openReport);
|
||||||
fileMenu.addItem("Open template...", cmd.openTemplate);
|
//fileMenu.addItem("Open template...", cmd.openTemplate);
|
||||||
fileMenu.addSeparator();
|
fileMenu.addSeparator();
|
||||||
fileMenu.addItem("Save", saveReport);
|
fileMenu.addItem("Save", saveReport);
|
||||||
fileMenu.addItem("Save As ..", saveReportAs);
|
fileMenu.addItem("Save As ..", saveReportAs);
|
||||||
|
@ -583,7 +628,7 @@ public class Headerbar extends Composite{
|
||||||
// fileMenu.addItem("Import from FiMES XML", importFimes);
|
// fileMenu.addItem("Import from FiMES XML", importFimes);
|
||||||
fileMenu.addItem("Close Report", cmd.newTemplate);
|
fileMenu.addItem("Close Report", cmd.newTemplate);
|
||||||
fileMenu.addSeparator();
|
fileMenu.addSeparator();
|
||||||
fileMenu.addItem("? Open User's Guide", openHelp);
|
// fileMenu.addItem("? Open User's Guide", openHelp);
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,13 +278,18 @@ public class Presenter {
|
||||||
dlg.hide();
|
dlg.hide();
|
||||||
}
|
}
|
||||||
public void onSuccess(Model result) {
|
public void onSuccess(Model result) {
|
||||||
|
if (isVME) {
|
||||||
|
header.setMenuForVME();
|
||||||
|
header.enableExports();
|
||||||
|
}
|
||||||
dlg.hide();
|
dlg.hide();
|
||||||
if (result != null) { //there was one report open in session
|
if (result != null) { //there was one report open in session
|
||||||
loadModel(result, true);
|
loadModel(result, true);
|
||||||
header.enableExports();
|
header.enableExports();
|
||||||
} else
|
} else{
|
||||||
commonCommands.newTemplate.execute();
|
commonCommands.newTemplate.execute();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +305,7 @@ public class Presenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showOpenOptions() {
|
public void showOpenOptions() {
|
||||||
wp.showOpenOptions();
|
wp.showOpenOptions(isVME);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showLoading() {
|
public void showLoading() {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateModel;
|
import org.gcube.portlets.user.reportgenerator.client.model.TemplateModel;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.targets.DoubleColumnPanel;
|
import org.gcube.portlets.user.reportgenerator.client.targets.DoubleColumnPanel;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.uibinder.OpenOptions;
|
import org.gcube.portlets.user.reportgenerator.client.uibinder.OpenOptions;
|
||||||
|
import org.gcube.portlets.user.reportgenerator.client.uibinder.OpenOptionsVME;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.uibinder.ShowLoading;
|
import org.gcube.portlets.user.reportgenerator.client.uibinder.ShowLoading;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -77,7 +78,10 @@ public class WorkspacePanel extends Composite {
|
||||||
//showOpenOptions();
|
//showOpenOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showOpenOptions() {
|
public void showOpenOptions(boolean isVME) {
|
||||||
|
if (isVME)
|
||||||
|
mainLayout.add(new OpenOptionsVME(presenter));
|
||||||
|
else
|
||||||
mainLayout.add(new OpenOptions(presenter));
|
mainLayout.add(new OpenOptions(presenter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,10 @@ public interface Images extends ImageBundle {
|
||||||
* @return .
|
* @return .
|
||||||
*/
|
*/
|
||||||
AbstractImagePrototype save();
|
AbstractImagePrototype save();
|
||||||
|
/**
|
||||||
|
* @return .
|
||||||
|
*/
|
||||||
|
AbstractImagePrototype db_save();
|
||||||
/**
|
/**
|
||||||
* @return .
|
* @return .
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -33,9 +33,9 @@ medium = Medium
|
||||||
large = Large
|
large = Large
|
||||||
xlarge = X-Large
|
xlarge = X-Large
|
||||||
xxlarge = XX-Large
|
xxlarge = XX-Large
|
||||||
save = Save
|
save = Save Report in Workspace
|
||||||
newdoc = New Template
|
newdoc = New Template
|
||||||
open_template = Open Template
|
open_template = Open Template
|
||||||
open_report = Open Report
|
open_report = Open Report from Workspace
|
||||||
importing = Import from Template
|
importing = Import from Template
|
||||||
forecolors = Text Color
|
forecolors = Text Color
|
||||||
|
|
|
@ -172,6 +172,7 @@ public class RichTextToolbar extends Composite {
|
||||||
private PushButton justifyCenter;
|
private PushButton justifyCenter;
|
||||||
private PushButton justifyRight;
|
private PushButton justifyRight;
|
||||||
private PushButton save;
|
private PushButton save;
|
||||||
|
private PushButton saveDB;
|
||||||
private PushButton newdoc;
|
private PushButton newdoc;
|
||||||
private PushButton open_template;
|
private PushButton open_template;
|
||||||
private PushButton open_report;
|
private PushButton open_report;
|
||||||
|
@ -229,17 +230,30 @@ public class RichTextToolbar extends Composite {
|
||||||
richText.addStyleName("hasRichTextToolbar");
|
richText.addStyleName("hasRichTextToolbar");
|
||||||
|
|
||||||
if (basic != null) {
|
if (basic != null) {
|
||||||
|
if (! isVme) {
|
||||||
//add the new template button
|
//add the new template button
|
||||||
topPanel.add(newdoc = createPushButton(images.newdoc(), strings.newdoc()));
|
topPanel.add(newdoc = createPushButton(images.newdoc(), strings.newdoc()));
|
||||||
|
}
|
||||||
open_report = createPushButton(images.open_report(),strings.open_report());
|
open_report = createPushButton(images.open_report(),strings.open_report());
|
||||||
//add the open report button
|
//add the open report button
|
||||||
topPanel.add(open_report);
|
topPanel.add(open_report);
|
||||||
|
if (! isVme) {
|
||||||
//add the open template button
|
//add the open template button
|
||||||
topPanel.add(open_template = createPushButton(images.open_template(),strings.open_template()));
|
topPanel.add(open_template = createPushButton(images.open_template(),strings.open_template()));
|
||||||
//add the save button
|
//add the save button
|
||||||
topPanel.add(save = createPushButton(images.save(), strings.save()));
|
|
||||||
//add the save button
|
|
||||||
topPanel.add(importing = createPushButton(images.importing(), strings.importing()));
|
topPanel.add(importing = createPushButton(images.importing(), strings.importing()));
|
||||||
|
}
|
||||||
|
//add the save button
|
||||||
|
topPanel.add(save = createPushButton(images.save(), strings.save()));
|
||||||
|
if (isVme) {
|
||||||
|
topPanel.add(saveDB = createPushButton(images.db_save(), "Commit current in VME-DB"));
|
||||||
|
saveDB.addClickHandler(new ClickHandler() {
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
Window.alert("Not currently available");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (! isVme) {
|
if (! isVme) {
|
||||||
topPanel.add(new HTML(" "));
|
topPanel.add(new HTML(" "));
|
||||||
|
@ -412,12 +426,14 @@ public class RichTextToolbar extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableCommands(boolean enable) {
|
public void enableCommands(boolean enable) {
|
||||||
|
open_report.setEnabled(enable);
|
||||||
save.setEnabled(enable);
|
save.setEnabled(enable);
|
||||||
|
if (newdoc != null) {
|
||||||
newdoc.setEnabled(enable);
|
newdoc.setEnabled(enable);
|
||||||
open_template.setEnabled(enable);
|
open_template.setEnabled(enable);
|
||||||
open_report.setEnabled(enable);
|
|
||||||
importing.setEnabled(enable);
|
importing.setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 454 B |
|
@ -42,7 +42,7 @@ public class OpenOptions extends Composite {
|
||||||
}
|
}
|
||||||
@UiHandler("openReport")
|
@UiHandler("openReport")
|
||||||
void onOpenReportClick(ClickEvent e) {
|
void onOpenReportClick(ClickEvent e) {
|
||||||
GWT.log("openReport");
|
GWT.log("editVME");
|
||||||
doAction(OpenMode.OPEN_REPORT);
|
doAction(OpenMode.OPEN_REPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
package org.gcube.portlets.user.reportgenerator.client.uibinder;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.reportgenerator.client.Presenter.CommonCommands;
|
||||||
|
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
||||||
|
import org.gcube.portlets.user.reportgenerator.client.uibinder.ExportOptions.ExportMode;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
|
import com.google.gwt.user.client.Command;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
public class OpenOptionsVME extends Composite {
|
||||||
|
|
||||||
|
private static OpenOptionsUiBinder uiBinder = GWT
|
||||||
|
.create(OpenOptionsUiBinder.class);
|
||||||
|
|
||||||
|
interface OpenOptionsUiBinder extends UiBinder<Widget, OpenOptionsVME> {
|
||||||
|
}
|
||||||
|
enum OpenMode {OPEN_REPORT, OPEN_TEMPLATE, UPLOAD }
|
||||||
|
|
||||||
|
@UiField HTML editVME;
|
||||||
|
@UiField HTML createVME;
|
||||||
|
@UiField HTML deleteVME;
|
||||||
|
|
||||||
|
@UiField HTMLPanel myPanel;
|
||||||
|
|
||||||
|
private Presenter p;
|
||||||
|
|
||||||
|
public OpenOptionsVME(Presenter p) {
|
||||||
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
this.p = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HTMLPanel getMainPanel() {
|
||||||
|
return myPanel;
|
||||||
|
}
|
||||||
|
@UiHandler("editVME")
|
||||||
|
void onEditVMEClick(ClickEvent e) {
|
||||||
|
GWT.log("editVME");
|
||||||
|
doAction(OpenMode.OPEN_REPORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiHandler("createVME")
|
||||||
|
void onOpenTemplateClick(ClickEvent e) {
|
||||||
|
doAction(OpenMode.OPEN_TEMPLATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiHandler("deleteVME")
|
||||||
|
void unUploadClick(ClickEvent e) {
|
||||||
|
doAction(OpenMode.UPLOAD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doAction(OpenMode mode) {
|
||||||
|
CommonCommands cmd = new CommonCommands(p);
|
||||||
|
switch (mode) {
|
||||||
|
case OPEN_REPORT:
|
||||||
|
p.showVMEImportDialog();
|
||||||
|
break;
|
||||||
|
case OPEN_TEMPLATE:
|
||||||
|
Window.alert("Not yet available");
|
||||||
|
break;
|
||||||
|
case UPLOAD:
|
||||||
|
Window.alert("Not yet available");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
|
<g:HTMLPanel styleName="openOptionsPanel" ui:field="myPanel">
|
||||||
|
<table style="width: 700px; text-align: center;">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<g:HTML ui:field="editVME" styleName="openOption optionOpenTemplate">Edit VME</g:HTML>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<g:HTML ui:field="createVME" styleName="openOption optionOpenReport">Create VME</g:HTML>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<g:HTML ui:field="deleteVME" styleName="openOption optionDeleteVME">Delete VME</g:HTML>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</g:HTMLPanel>
|
||||||
|
</ui:UiBinder>
|
|
@ -55,6 +55,10 @@
|
||||||
background: url('images/uploadReport.png') 55% 25px no-repeat;
|
background: url('images/uploadReport.png') 55% 25px no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.optionDeleteVME {
|
||||||
|
background: url('images/deleteVME.png') 55% 25px no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
.exportPanel {
|
.exportPanel {
|
||||||
margin: 5px 5px 5px 20px;
|
margin: 5px 5px 5px 20px;
|
||||||
border: 1px solid #e3e8f3;
|
border: 1px solid #e3e8f3;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
Reference in New Issue