ADDED SUPPORT FOR RICH TEXT INPUT in VME DB Case

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@97806 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2014-06-25 16:33:07 +00:00
parent f436cf7b57
commit c3878362c3
4 changed files with 82 additions and 85 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/reports-4.9.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/reports-4.9.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/reports-4.9.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/reports-4.9.1-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine <<<<<<<=.mine
>>>>>>>=.r71295 >>>>>>>=.r71295
eclipse.preferences.version=1 eclipse.preferences.version=1
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.9.0-SNAPSHOT lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.9.1-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>reports</artifactId> <artifactId>reports</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>4.9.0-SNAPSHOT</version> <version>4.9.1-SNAPSHOT</version>
<name>gCube Reports Manager</name> <name>gCube Reports Manager</name>
<description> <description>
gCube Reports Portlet. gCube Reports Portlet.

View File

@ -122,11 +122,11 @@ public class RichTextToolbar extends Composite {
} else if (sender == removeLink) { } else if (sender == removeLink) {
extended.removeLink(); extended.removeLink();
} }
// else if (sender == ol) { else if (sender == ol) {
// extended.insertOrderedList(); extended.insertOrderedList();
// } else if (sender == ul) { } else if (sender == ul) {
// extended.insertUnorderedList(); extended.insertUnorderedList();
// } }
else if (sender == foreColorButton) { else if (sender == foreColorButton) {
commands.get("pickColor").execute(); commands.get("pickColor").execute();
} }
@ -189,8 +189,8 @@ public class RichTextToolbar extends Composite {
private PushButton open_report; private PushButton open_report;
private PushButton importing; private PushButton importing;
// private PushButton ol; private PushButton ol;
// private PushButton ul; private PushButton ul;
private PushButton insertImage; private PushButton insertImage;
private PushButton createLink; private PushButton createLink;
private PushButton removeLink; private PushButton removeLink;
@ -263,70 +263,69 @@ public class RichTextToolbar extends Composite {
topPanel.add(saveDB = createPushButton(images.db_save(), "Commit current in VME-DB")); //TODO: topPanel.add(saveDB = createPushButton(images.db_save(), "Commit current in VME-DB")); //TODO:
} }
if (! isVme) { topPanel.add(new HTML("&nbsp;"));
topPanel.add(new HTML("&nbsp;")); fonts = createFontList();
fonts = createFontList(); fonts.setPixelSize(150, 18);
fonts.setPixelSize(150, 18); topPanel.add(fonts);
topPanel.add(fonts); topPanel.add(new HTML("&nbsp;"));
topPanel.add(new HTML("&nbsp;")); topPanel.add(fontSizes = createFontSizes());
topPanel.add(fontSizes = createFontSizes());
}
// We only use these listeners for updating status, so don't hook them up // We only use these listeners for updating status, so don't hook them up
// unless at least basic editing is supported. // unless at least basic editing is supported.
richText.addKeyUpHandler(listener); richText.addKeyUpHandler(listener);
richText.addClickHandler(listener); richText.addClickHandler(listener);
} }
if (! isVme) {
if (basic != null) { if (basic != null) {
topPanel.add(bold = createToggleButton(images.bold(), strings.bold())); topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
topPanel.add(italic = createToggleButton(images.italic(), strings.italic())); topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
topPanel.add(underline = createToggleButton(images.underline(), strings.underline())); topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
topPanel.add(new HTML("&nbsp;", true)); topPanel.add(new HTML("&nbsp;", true));
topPanel.add(subscript = createToggleButton(images.subscript(),"subscript")); topPanel.add(subscript = createToggleButton(images.subscript(),"subscript"));
topPanel.add(superscript = createToggleButton(images.superscript(), topPanel.add(superscript = createToggleButton(images.superscript(),
"superscript")); "superscript"));
topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), topPanel.add(strikethrough = createToggleButton(images.strikeThrough(),
strings.strikeThrough())); strings.strikeThrough()));
topPanel.add(new HTML("&nbsp;", true)); topPanel.add(new HTML("&nbsp;", true));
topPanel.add(justifyLeft = createPushButton(images.justifyLeft(), topPanel.add(justifyLeft = createPushButton(images.justifyLeft(),
strings.justifyLeft())); strings.justifyLeft()));
topPanel.add(justifyCenter = createPushButton(images.justifyCenter(), topPanel.add(justifyCenter = createPushButton(images.justifyCenter(),
strings.justifyCenter())); strings.justifyCenter()));
topPanel.add(justifyRight = createPushButton(images.justifyRight(), topPanel.add(justifyRight = createPushButton(images.justifyRight(),
strings.justifyRight())); strings.justifyRight()));
topPanel.add(new HTML("&nbsp;", true)); topPanel.add(new HTML("&nbsp;", true));
}
if (extended != null) {
// topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
// topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
//TODO: To be re-enabled in the future
// topPanel.add(insertImage = createPushButton(images.insertImage(),
// strings.insertImage()));
topPanel.add(createLink = createPushButton(images.createLink(),
strings.createLink()));
topPanel.add(removeLink = createPushButton(images.removeLink(),
strings.removeLink()));
topPanel.add(removeFormat = createPushButton(images.removeFormat(),
strings.removeFormat()));
topPanel.add(foreColorButton = createPushButton(images.foreColors(),
"Text Color"));
}
if (basic != null) {
topPanel.add(new HTML("&nbsp;"));
// topPanel.add(foreColors = createColorList("Color"));
// foreColors.setStyleName("listbox");
}
} }
if (extended != null) {
topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
topPanel.add(ul = createPushButton(images.ul(), strings.ul()));
//TODO: To be re-enabled in the future
// topPanel.add(insertImage = createPushButton(images.insertImage(),
// strings.insertImage()));
topPanel.add(createLink = createPushButton(images.createLink(),
strings.createLink()));
topPanel.add(removeLink = createPushButton(images.removeLink(),
strings.removeLink()));
topPanel.add(removeFormat = createPushButton(images.removeFormat(),
strings.removeFormat()));
topPanel.add(foreColorButton = createPushButton(images.foreColors(),
"Text Color"));
}
if (basic != null) {
topPanel.add(new HTML("&nbsp;"));
// topPanel.add(foreColors = createColorList("Color"));
// foreColors.setStyleName("listbox");
}
} }
private ListBox createFontList() { private ListBox createFontList() {
@ -410,27 +409,25 @@ public class RichTextToolbar extends Composite {
* @param enable true to enable the widget, false to disable it * @param enable true to enable the widget, false to disable it
*/ */
public void setEnabled(boolean enable) { public void setEnabled(boolean enable) {
if (! isVME) { bold.setEnabled(enable);
bold.setEnabled(enable); italic.setEnabled(enable);
italic.setEnabled(enable); underline.setEnabled(enable);
underline.setEnabled(enable); strikethrough.setEnabled(enable);
strikethrough.setEnabled(enable); justifyLeft.setEnabled(enable);
justifyLeft.setEnabled(enable); justifyCenter.setEnabled(enable);
justifyCenter.setEnabled(enable); justifyRight.setEnabled(enable);
justifyRight.setEnabled(enable); superscript.setEnabled(enable);
superscript.setEnabled(enable); subscript.setEnabled(enable);
subscript.setEnabled(enable); foreColorButton.setEnabled(enable);
foreColorButton.setEnabled(enable); // insertImage.setEnabled(enable);
// insertImage.setEnabled(enable); ol.setEnabled(enable);
// ol.setEnabled(enable); ul.setEnabled(enable);
// ul.setEnabled(enable); createLink.setEnabled(enable);
createLink.setEnabled(enable); removeLink.setEnabled(enable);
removeLink.setEnabled(enable); removeFormat.setEnabled(enable);
removeFormat.setEnabled(enable); //foreColors.setEnabled(enable);
//foreColors.setEnabled(enable); fonts.setEnabled(enable);
fonts.setEnabled(enable); fontSizes.setEnabled(enable);
fontSizes.setEnabled(enable);
}
} }
public void enableCommands(boolean enable) { public void enableCommands(boolean enable) {