Fixed TimeZone

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-rule-widget@115609 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-29 12:36:41 +00:00 committed by Giancarlo Panichi
parent a6e93b1c8e
commit 2fe572e45c
9 changed files with 64 additions and 88 deletions

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -22,9 +23,11 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -56,7 +59,11 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
private static final String WIDTH = "760px";
private static final String HEIGHT = "418px";
private static final String RULES_GRID_HEIGHT = "102px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleActiveTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
SafeHtml format(String value);
@ -210,18 +217,10 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
propsRules.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleActiveTemplates ruleActiveTemplates = GWT
.create(RuleActiveTemplates.class);
sb.append(ruleActiveTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
@ -17,9 +18,11 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -50,7 +53,8 @@ import com.sencha.gxt.widget.core.client.menu.MenuItem;
public class RuleActiveOnTablePanel extends FramedPanel {
private static final String WIDTH = "760px";
private static final String HEIGHT = "418px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleActiveTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
SafeHtml format(String value);
@ -139,19 +143,11 @@ public class RuleActiveOnTablePanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
propsRules.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleActiveTemplates ruleActiveTemplates = GWT
.create(RuleActiveTemplates.class);
sb.append(ruleActiveTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);
l.add(descriptionCol);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
@ -14,6 +15,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
@ -21,6 +23,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -66,6 +69,7 @@ public class RuleDeletePanel extends FramedPanel {
private static final String WIDTH = "760px";
private static final String HEIGHT = "520px";
private static final String GRID_HEIGHT = "384px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleDeleteTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
@ -164,19 +168,11 @@ public class RuleDeletePanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
props.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleDeleteTemplates ruleDeleteTemplates = GWT
.create(RuleDeleteTemplates .class);
sb.append(ruleDeleteTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.rulewidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
@ -21,7 +22,10 @@ import com.sencha.gxt.widget.core.client.form.TextField;
*
*/
public class RuleInfoDialog extends Dialog {
RuleDescriptionData ruleDescriptionData;
private static final DateTimeFormat sdf = DateTimeFormat
.getFormat("yyyy-MM-dd HH:mm");
private RuleDescriptionData ruleDescriptionData;
public RuleInfoDialog(RuleDescriptionData ruleDescriptionData) {
this.ruleDescriptionData = ruleDescriptionData;
@ -80,7 +84,8 @@ public class RuleInfoDialog extends Dialog {
1, -1, new Margins(0)));
TextField ruleCreationDate = new TextField();
ruleCreationDate.setValue(ruleDescriptionData.getCreationDate());
ruleCreationDate.setValue(sdf.format(ruleDescriptionData
.getCreationDate()));
ruleCreationDate.setReadOnly(true);
FieldLabel ruleCreationDateLabel = new FieldLabel(ruleCreationDate,
"Creation Date");

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -23,9 +24,11 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -74,7 +77,8 @@ public class RuleOnColumnApplyPanel extends FramedPanel {
private static final String RULE_TIP = "<p>Tip.: Use drag and drop in order to change selected rules.</p>";
private static final String RULES_GRID_HEIGHT = "184px";
private static final String SET_RULES = "SetRules";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleApplyTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
SafeHtml format(String value);
@ -236,19 +240,11 @@ public class RuleOnColumnApplyPanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
propsRules.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleApplyTemplates ruleApplyTemplates = GWT
.create(RuleApplyTemplates .class);
sb.append(ruleApplyTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
@ -14,6 +15,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
@ -21,6 +23,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -72,6 +75,7 @@ public class RuleOpenPanel extends FramedPanel {
private static final String WIDTH = "760px";
private static final String HEIGHT = "520px";
private static final String GRID_HEIGHT = "384px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleOpenTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
@ -170,19 +174,11 @@ public class RuleOpenPanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
props.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleOpenTemplates ruleOpenTemplates = GWT
.create(RuleOpenTemplates .class);
sb.append(ruleOpenTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);
l.add(scopeCol);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
@ -14,6 +15,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
@ -21,6 +23,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -72,6 +75,7 @@ public class RuleSharePanel extends FramedPanel {
private static final String WIDTH = "760px";
private static final String HEIGHT = "520px";
private static final String GRID_HEIGHT = "384px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
private EventBus eventBus;
private RuleShareDialog parent;
@ -170,20 +174,11 @@ public class RuleSharePanel extends FramedPanel {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
props.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleShareTemplates ruleShareTemplates = GWT
.create(RuleShareTemplates .class);
sb.append(ruleShareTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);
l.add(scopeCol);

View File

@ -1,6 +1,7 @@
package org.gcube.portlets.user.td.rulewidget.client.multicolumn;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
@ -18,6 +19,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
@ -25,6 +27,7 @@ import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command;
@ -73,9 +76,9 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
*
*/
public class RuleOnTableApplySelectRuleCard extends WizardCard {
private static final String GRID_HEIGHT = "334px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
interface RuleOnTableSelectTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>")
SafeHtml format(String value);
@ -177,18 +180,10 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
}
});
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
props.creationDate(), 56, "Creation Date");
creationDateCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleOnTableSelectTemplates ruleOnTableSelectTemplates = GWT
.create(RuleOnTableSelectTemplates.class);
sb.append(ruleOnTableSelectTemplates.format(value));
}
});
creationDateCol.setCell(new DateCell(sdf));
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol);

View File

@ -10,7 +10,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.Command;
import com.sencha.gxt.core.client.util.Padding;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
@ -26,7 +25,6 @@ import com.sencha.gxt.widget.core.client.form.FormPanel;
*
*/
public class RuleOnTableNewExpressionCard extends WizardCard {
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");
private RuleOnTableNewExpressionCard thisCard;
private TDRuleTableType tdRuleTableType;
private RuleDescriptionData ruleDescriptionData;
@ -47,7 +45,7 @@ public class RuleOnTableNewExpressionCard extends WizardCard {
panel.setLabelWidth(90);
panel.getElement().setPadding(new Padding(5));
ruleDescriptionData=new RuleDescriptionData(0, null, null,sdf.format(new Date()),null, null,RuleScopeType.TABLE, null, tdRuleTableType);
ruleDescriptionData=new RuleDescriptionData(0, null, null,new Date(),null, null,RuleScopeType.TABLE, null, tdRuleTableType);
try {
multiColumnExpressionPanel = new MultiColumnExpressionPanel(null, ruleDescriptionData);
panel.add(multiColumnExpressionPanel);