partially updated styles

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@69272 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-02-14 15:04:02 +00:00
parent 92a551d982
commit ab9f9043df
2 changed files with 47 additions and 59 deletions

View File

@ -35,7 +35,7 @@ public class D4sRichTextarea extends ReportTextArea {
*/
private RichTextArea area = new RichTextArea();
TextArea text = new TextArea();
/**
* a flag
@ -43,7 +43,7 @@ public class D4sRichTextarea extends ReportTextArea {
boolean firstClick = true;
int currHeight = 0;
VerticalPanel myPanel;
/**
*
@ -68,28 +68,15 @@ public class D4sRichTextarea extends ReportTextArea {
area.setPixelSize(width-6, height-2);
area.setStyleName("d4sRichTextArea");
switch (type) {
case TITLE:
area.addStyleName("");
break;
case HEADING_1:
area.addStyleName("");
break;
case HEADING_2:
area.addStyleName("");
break;
case HEADING_3:
area.addStyleName("");
break;
case BODY:
area.addStyleName("bodyArea");
break;
default:
break;
}
myPanel.add(area);
//repositionMyPanel(0, 15);
myPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
@ -101,7 +88,7 @@ public class D4sRichTextarea extends ReportTextArea {
if (event.getNativeButton() == Event.BUTTON_RIGHT) {
event.preventDefault();
event.stopPropagation();
MessageBox.alert("Warning","Please, use CTRL+V (CMD+V) for pasting into this area", null);
MessageBox.alert("Warning","Please, use CTRL+V (CMD+V) for pasting into this area", null);
}
if (firstClick) {
presenter.enableTextToolBar(area);
@ -126,44 +113,44 @@ public class D4sRichTextarea extends ReportTextArea {
firstClick = true;
presenter.storeChangeInSession((Widget) event.getSource());
}
});
//TODO: aggiorna
// area.addKeyDownHandler(new KeyDownHandler() {
// public void onKeyDown(KeyDownEvent event) {
//// if (event.isAnyModifierKeyDown() && event.getNativeKeyCode() == 86) { //event.getNativeKeyCode() == 86 is the V (to avoid ctrl V or cmd V)
//// MessageBox.show(new MessageBoxConfig() {
//// {
//// setTitle("Paste operation");
//// setMsg("Please enter your text here (PLAIN)");
//// setWidth(500);
//// setButtons(MessageBox.OKCANCEL);
//// setMultiline(true);
//// setCallback(new MessageBox.PromptCallback() {
//// public void execute(String btnID, String text) {
//// if (btnID.compareTo("ok") == 0) {
//// area.setText(text);
////
//// //resize if needed
//// HTML div = ReportGenerator.get().getDivHidden();
//// //GWT.log("element.getHTML():\n" + area.getHTML(), null);
//// div.setHTML(area.getHTML());
//// int newHeight = div.getOffsetHeight()+20 ;
//// if (newHeight > height-10 && newHeight != currHeight) {
//// resizePanel(myPanel.getOffsetWidth(), div.getOffsetHeight());
//// }
//// }
////
//// }
//// });
//// }
//// });
// event.stopPropagation();
// event.preventDefault();
// }
//
// }
// });
// area.addKeyDownHandler(new KeyDownHandler() {
// public void onKeyDown(KeyDownEvent event) {
//// if (event.isAnyModifierKeyDown() && event.getNativeKeyCode() == 86) { //event.getNativeKeyCode() == 86 is the V (to avoid ctrl V or cmd V)
//// MessageBox.show(new MessageBoxConfig() {
//// {
//// setTitle("Paste operation");
//// setMsg("Please enter your text here (PLAIN)");
//// setWidth(500);
//// setButtons(MessageBox.OKCANCEL);
//// setMultiline(true);
//// setCallback(new MessageBox.PromptCallback() {
//// public void execute(String btnID, String text) {
//// if (btnID.compareTo("ok") == 0) {
//// area.setText(text);
////
//// //resize if needed
//// HTML div = ReportGenerator.get().getDivHidden();
//// //GWT.log("element.getHTML():\n" + area.getHTML(), null);
//// div.setHTML(area.getHTML());
//// int newHeight = div.getOffsetHeight()+20 ;
//// if (newHeight > height-10 && newHeight != currHeight) {
//// resizePanel(myPanel.getOffsetWidth(), div.getOffsetHeight());
//// }
//// }
////
//// }
//// });
//// }
//// });
// event.stopPropagation();
// event.preventDefault();
// }
//
// }
// });
area.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
HTML div = ReportGenerator.get().getDivHidden();
@ -173,7 +160,7 @@ public class D4sRichTextarea extends ReportTextArea {
presenter.shiftComponentsByTextArea(myInstance.top, newHeight - currHeight);
resizePanel(myPanel.getOffsetWidth(), div.getOffsetHeight());
//Window.alert("myInstance.top: " + myInstance.top);
presenter.resizeTemplateComponentInModel(myInstance, myPanel.getOffsetWidth(), newHeight);
presenter.resizeTemplateComponentInModel(myInstance, myPanel.getOffsetWidth()+5, newHeight);
}
}
});
@ -202,7 +189,7 @@ public class D4sRichTextarea extends ReportTextArea {
public String getHTML() {
return area.getHTML();
}
/**
* @param html the html
*/

View File

@ -85,7 +85,6 @@ tableBorder td {
border: none;
}
.fixedTextArea {
font-family: Times;
font-size: 20px;
@ -233,12 +232,14 @@ tableBorder td {
}
.d4sFrame {
border: 1px dashed #CCC;
border: 1px solid #CCC;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color: white;
margin-top: 5px;
}
.report-ui-component {
background-repeat: no-repeat;
color: maroon;