structure view cimplete

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@87167 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-12-18 16:33:25 +00:00
parent b18bea1b92
commit 0254eb1a9c
10 changed files with 46 additions and 12 deletions

View File

@ -26,7 +26,7 @@
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>

View File

@ -7,6 +7,9 @@
<dependent-module archiveName="gcube-reporting-modeler-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-modeler/gcube-reporting-modeler"> <dependent-module archiveName="gcube-reporting-modeler-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-modeler/gcube-reporting-modeler">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="gcube-reporting-library-3.4.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-library/gcube-reporting-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="reports"/> <property name="context-root" value="reports"/>
</wb-module> </wb-module>

View File

@ -540,7 +540,7 @@ public class Headerbar extends Composite{
Command showReportStructure = new Command() { Command showReportStructure = new Command() {
public void execute() { public void execute() {
presenter.showReportStructure(); presenter.toggleReportStructure();
} }
}; };
@ -553,7 +553,7 @@ public class Headerbar extends Composite{
MenuItem toReturn = new MenuItem("View", optionsMenu); MenuItem toReturn = new MenuItem("View", optionsMenu);
optionsMenu.addItem("View Properties", openPageProperties); optionsMenu.addItem("View Properties", openPageProperties);
optionsMenu.addItem("View Structure", showReportStructure); optionsMenu.addItem("View/Hide Structure", showReportStructure);
optionsMenu.addSeparator(); optionsMenu.addSeparator();
return toReturn; return toReturn;

View File

@ -51,7 +51,11 @@ public class CommonCommands {
/** /**
* *
*/ */
public Command saveTemplate; public Command saveTemplate;
/**
*
*/
public Command structureView;
/** /**
* *
*/ */
@ -65,7 +69,11 @@ public class CommonCommands {
*/ */
public CommonCommands(final Presenter presenter) { public CommonCommands(final Presenter presenter) {
this.presenter = presenter; this.presenter = presenter;
structureView = new Command() {
public void execute() {
presenter.toggleReportStructure();
}
};
newTemplate = new Command() { newTemplate = new Command() {
public void execute() { public void execute() {
presenter.changeTemplateName(TemplateModel.DEFAULT_NAME); presenter.changeTemplateName(TemplateModel.DEFAULT_NAME);

View File

@ -417,6 +417,7 @@ public class Presenter {
*/ */
HashMap<String, Command> toReturn = new HashMap<String, Command>(); HashMap<String, Command> toReturn = new HashMap<String, Command>();
toReturn.put("structureView", commonCommands.structureView);
toReturn.put("save", commonCommands.saveTemplate); toReturn.put("save", commonCommands.saveTemplate);
toReturn.put("newdoc", commonCommands.newTemplate); toReturn.put("newdoc", commonCommands.newTemplate);
toReturn.put("open_report", commonCommands.openReport); toReturn.put("open_report", commonCommands.openReport);
@ -808,8 +809,7 @@ public class Presenter {
if (currPage > 1) if (currPage > 1)
titleBar.getSectionSwitchPanel().showPrevButton(); titleBar.getSectionSwitchPanel().showPrevButton();
//show the structure
showReportStructure();
} }
/** /**
@ -1126,9 +1126,19 @@ public class Presenter {
areaForBiblio = d4sArea; areaForBiblio = d4sArea;
} }
/**
public void showReportStructure() { * show/hide the structure view
toolBoxPanel.showStructure(new ReportStructurePanel(eventBus, model.getSerializableModel(), ToolboxPanel.TOOLBOX_WIDTH+"px", ToolboxPanel.TOOLBOX_HEIGHT+"px")); */
boolean hidden = true;
public void toggleReportStructure() {
if (hidden) {
toolBoxPanel.showStructure(new ReportStructurePanel(eventBus, model.getSerializableModel(), ToolboxPanel.TOOLBOX_WIDTH+"px", ToolboxPanel.TOOLBOX_HEIGHT+"px"));
hidden = false;
}
else {
toolBoxPanel.collapse();
hidden = true;
}
} }
public HorizontalPanel getExportsPanel() { public HorizontalPanel getExportsPanel() {

View File

@ -43,6 +43,8 @@ public class ToolboxPanel extends VerticalPanel {
} }
public void collapse() { public void collapse() {
clear();
GWT.log("collapse");
setWidth("20px"); setWidth("20px");
} }

View File

@ -87,6 +87,10 @@ public interface Images extends ImageBundle {
* @return . * @return .
*/ */
AbstractImagePrototype db_save(); AbstractImagePrototype db_save();
/**
* @return .
*/
AbstractImagePrototype structureView();
/** /**
* @return . * @return .
*/ */

View File

@ -39,4 +39,5 @@ open_template = Open Template
open_report = Open Report from Workspace open_report = Open Report from Workspace
importing = Import from Template importing = Import from Template
forecolors = Text Color forecolors = Text Color
close_report = Close Report close_report = Close Report
structureView = Show/Hide Structure View

View File

@ -80,6 +80,8 @@ public class RichTextToolbar extends Composite {
commands.get("save").execute(); commands.get("save").execute();
} else if (sender == newdoc) { } else if (sender == newdoc) {
commands.get("newdoc").execute(); commands.get("newdoc").execute();
}else if (sender == structureView) {
commands.get("structureView").execute();
}else if (sender == close) { }else if (sender == close) {
commands.get("newdoc").execute(); commands.get("newdoc").execute();
} else if (sender == open_report) { } else if (sender == open_report) {
@ -163,7 +165,8 @@ public class RichTextToolbar extends Composite {
private VerticalPanel outer = new VerticalPanel(); private VerticalPanel outer = new VerticalPanel();
private HorizontalPanel topPanel = new HorizontalPanel(); private HorizontalPanel topPanel = new HorizontalPanel();
private HorizontalPanel bottomPanel = new HorizontalPanel(); private HorizontalPanel bottomPanel = new HorizontalPanel();
private ToggleButton structureView;
private ToggleButton bold; private ToggleButton bold;
private ToggleButton italic; private ToggleButton italic;
private ToggleButton underline; private ToggleButton underline;
@ -233,6 +236,7 @@ public class RichTextToolbar extends Composite {
richText.addStyleName("hasRichTextToolbar"); richText.addStyleName("hasRichTextToolbar");
if (basic != null) { if (basic != null) {
topPanel.add(structureView = createToggleButton(images.structureView(), strings.structureView()));
if (! isVme) { 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()));
@ -520,6 +524,8 @@ public class RichTextToolbar extends Composite {
String small(); String small();
String strikeThrough(); String strikeThrough();
String structureView();
String ul(); String ul();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB