Updated Column Expression Panel
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@90448 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
04f2a3efc3
commit
bba30e3bc0
|
@ -126,3 +126,35 @@ Compiling...
|
|||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||
Compiling...
|
||||
40% complete (ETR: 6 seconds)
|
||||
40% complete (ETR: 6 seconds)
|
||||
40% complete (ETR: 6 seconds)
|
||||
40% complete (ETR: 6 seconds)
|
||||
40% complete (ETR: 6 seconds)
|
||||
50% complete (ETR: 5 seconds)
|
||||
60% complete (ETR: 4 seconds)
|
||||
70% complete (ETR: 3 seconds)
|
||||
80% complete (ETR: 2 seconds)
|
||||
90% complete (ETR: 1 seconds)
|
||||
100% complete (ETR: 0 seconds)
|
||||
Compilation completed in 17.24 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
|
|
|
@ -4,15 +4,6 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="tabular-data-gwt-service-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-gwt-service/tabular-data-gwt-service">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="tabular-model-3.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-model/tabular-model">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="tabular-data-widget-common-event-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget-common-event/tabular-data-widget-common-event">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="tabular-data-column-widget"/>
|
||||
<property name="java-output-path" value="/tabular-data-column-widget/target/tabular-data-column-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.custom.ErrorMessageDialog;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
@ -29,6 +29,7 @@ import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
|||
import com.sencha.gxt.widget.core.client.ContentPanel;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.Window;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
|
@ -172,9 +173,8 @@ public class ChangeLabelColumnDialog extends Window {
|
|||
callback.onFailure(c);
|
||||
}
|
||||
};
|
||||
ErrorMessageDialog d = new ErrorMessageDialog("Error",
|
||||
"Error loading data", caught
|
||||
.getLocalizedMessage());
|
||||
AlertMessageBox d = new AlertMessageBox("Error",
|
||||
caught.getMessage());
|
||||
d.addHideHandler(hideHandler);
|
||||
d.show();
|
||||
|
||||
|
|
|
@ -2,13 +2,10 @@ package org.gcube.portlets.user.td.columnwidget.client;
|
|||
|
||||
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.custom.ErrorMessageDialog;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.EntryPoint;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
|
||||
public class ColumnWidgetEntry implements EntryPoint {
|
||||
|
||||
|
@ -18,26 +15,17 @@ public class ColumnWidgetEntry implements EntryPoint {
|
|||
//For example Tabular Resource 1 and table 1
|
||||
trId.setId("1");
|
||||
trId.setTableId("1");
|
||||
|
||||
RemoveColumnDialog dialog=new RemoveColumnDialog(trId);
|
||||
dialog.show();
|
||||
ChangeLabelColumnDialog changeLabel=new ChangeLabelColumnDialog(trId);
|
||||
changeLabel.show();
|
||||
ChangeToAnnotationColumnDialog changeToAnnotation=new ChangeToAnnotationColumnDialog(trId);
|
||||
changeToAnnotation.show();
|
||||
|
||||
ChangeColumnTypeDialog changeColumnType=new ChangeColumnTypeDialog(trId);
|
||||
changeColumnType.show();
|
||||
|
||||
HideHandler hideHandler = new HideHandler() {
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
};
|
||||
ErrorMessageDialog d = new ErrorMessageDialog("Error",
|
||||
"Error loading data", new Throwable("Che bello poter scrivere tanto")
|
||||
.getLocalizedMessage());
|
||||
d.addHideHandler(hideHandler);
|
||||
d.show();
|
||||
|
||||
Log.info("Hello!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.custom;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.custom.ErrorMessageDialog.ErrorMessageDialogAppearance;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.resources.client.ClientBundle.Source;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sencha.gxt.core.client.XTemplates;
|
||||
import com.sencha.gxt.core.client.dom.XElement;
|
||||
|
||||
public class DefaultErrorMessageDialogApperance implements ErrorMessageDialogAppearance {
|
||||
|
||||
public interface Template extends XTemplates {
|
||||
@XTemplate(source = "ErrorMessageDialog.html")
|
||||
SafeHtml template(ErrorMessageDialogStyle style);
|
||||
}
|
||||
|
||||
public interface ErrorMessageDialogStyle extends CssResource {
|
||||
@ClassName("container")
|
||||
public String getContainer();
|
||||
|
||||
@ClassName("error")
|
||||
public String getError();
|
||||
|
||||
@ClassName("errorExtended")
|
||||
public String getErrorExtended();
|
||||
|
||||
@ClassName("errorExtendedContainer")
|
||||
public String getErrorExtendedContainer();
|
||||
|
||||
}
|
||||
|
||||
private final ErrorMessageDialogStyle style;
|
||||
private final Template template;
|
||||
|
||||
public interface ErrorMessageDialogResources extends ClientBundle {
|
||||
public static final ErrorMessageDialogResources INSTANCE = GWT.create(ErrorMessageDialogResources.class);
|
||||
|
||||
@Source("ErrorMessageDialog.css")
|
||||
ErrorMessageDialogStyle style();
|
||||
|
||||
@Source("exclamation.png")
|
||||
ImageResource error();
|
||||
|
||||
@Source("exclamation_32.png")
|
||||
ImageResource error32();
|
||||
|
||||
}
|
||||
|
||||
public DefaultErrorMessageDialogApperance() {
|
||||
this(ErrorMessageDialogResources.INSTANCE);
|
||||
}
|
||||
|
||||
public DefaultErrorMessageDialogApperance(ErrorMessageDialogResources resources) {
|
||||
this.style = resources.style();
|
||||
this.style.ensureInjected();
|
||||
|
||||
this.template = GWT.create(Template.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void render(SafeHtmlBuilder sb) {
|
||||
sb.append(template.template(style));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public XElement getMessageElement(XElement parent) {
|
||||
XElement element = parent.selectNode("." + style.getError());
|
||||
return element;
|
||||
}
|
||||
|
||||
public XElement getExtendedElement(XElement parent) {
|
||||
XElement element = parent.selectNode("." + style.getErrorExtended());
|
||||
return element;
|
||||
|
||||
}
|
||||
|
||||
public ImageResource getWindowIcon(){
|
||||
return ErrorMessageDialogResources.INSTANCE.error();
|
||||
};
|
||||
|
||||
/*public void onUpdateIcon(XElement parent, ImageResource icon) {
|
||||
XElement element = parent.selectNode("." + style.getIconButtonImage());
|
||||
Image image=new Image(icon);
|
||||
Element img=image.getElement();
|
||||
img.setClassName(style.getIconButtonRef());
|
||||
element.appendChild(img);
|
||||
|
||||
}*/
|
||||
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
.container {
|
||||
background-color: #dfe8f6;
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
.error {
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
margin: 2px;
|
||||
padding: 8px 0px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.errorExtended {
|
||||
resize: none;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.errorExtendedContainer {
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
<!-- file: ./IconButton.html -->
|
||||
<div class="{style.container}">
|
||||
<div class="{style.error}">
|
||||
</div>
|
||||
<div class="{style.errorExtendedContainer}">
|
||||
<textarea class="{style.errorExtended}" cols="86" rows="16">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
|
@ -1,110 +0,0 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.custom;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sencha.gxt.core.client.dom.XElement;
|
||||
import com.sencha.gxt.widget.core.client.Dialog;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
||||
|
||||
public class ErrorMessageDialog extends Dialog {
|
||||
|
||||
public interface ErrorMessageDialogAppearance {
|
||||
|
||||
XElement getMessageElement(XElement parent);
|
||||
|
||||
XElement getExtendedElement(XElement parent);
|
||||
|
||||
ImageResource getWindowIcon();
|
||||
|
||||
void render(SafeHtmlBuilder sb);
|
||||
}
|
||||
|
||||
protected ImageResource icon;
|
||||
protected ErrorMessageDialogAppearance contentAppearance;
|
||||
|
||||
public ErrorMessageDialog(String headingHtml, String messageHtml,
|
||||
String extendedHtml) {
|
||||
this(headingHtml, messageHtml, extendedHtml, (WindowAppearance) GWT
|
||||
.create(WindowAppearance.class),
|
||||
(ErrorMessageDialogAppearance) GWT
|
||||
.create(DefaultErrorMessageDialogApperance.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a message box with the specified heading HTML, message HTML and
|
||||
* appearance. It is the caller's responsibility to ensure the HTML is CSS
|
||||
* safe.
|
||||
*
|
||||
* @param headingHtml
|
||||
* the HTML to display for the message box heading
|
||||
* @param messageHtml
|
||||
* the HTML to display in the message box
|
||||
* @param extendedHtml
|
||||
* the HTML to display in the extended box
|
||||
* @param appearance
|
||||
* the message box window appearance
|
||||
* @param contentAppearance
|
||||
* the message box content appearance
|
||||
*/
|
||||
public ErrorMessageDialog(String headingHtml, String messageHtml,
|
||||
String extendedHtml, WindowAppearance appearance,
|
||||
ErrorMessageDialogAppearance contentAppearance) {
|
||||
super(appearance);
|
||||
|
||||
setWidth(650);
|
||||
//setHeight(350);
|
||||
getHeader().setIcon(contentAppearance.getWindowIcon());
|
||||
|
||||
setResizable(false);
|
||||
|
||||
this.contentAppearance = contentAppearance;
|
||||
|
||||
setHeadingHtml(headingHtml);
|
||||
|
||||
init();
|
||||
|
||||
SafeHtmlBuilder sb = new SafeHtmlBuilder();
|
||||
contentAppearance.render(sb);
|
||||
|
||||
appearance.getContentElem(getElement()).setInnerHTML(
|
||||
sb.toSafeHtml().asString());
|
||||
|
||||
contentAppearance.getMessageElement(getElement()).setId(
|
||||
getId() + "-content");
|
||||
|
||||
if (messageHtml != null) {
|
||||
contentAppearance.getMessageElement(getElement()).setInnerHTML(
|
||||
messageHtml);
|
||||
}
|
||||
|
||||
if (extendedHtml != null) {
|
||||
contentAppearance.getExtendedElement(getElement()).setInnerHTML(
|
||||
extendedHtml);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the message.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
contentAppearance.getMessageElement(getElement()).setInnerHTML(message);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setData("errorMessageDialog", true);
|
||||
setResizable(false);
|
||||
setConstrain(true);
|
||||
setMinimizable(false);
|
||||
setMaximizable(false);
|
||||
setClosable(false);
|
||||
setModal(true);
|
||||
setButtonAlign(BoxLayoutPack.CENTER);
|
||||
setPredefinedButtons(PredefinedButton.OK);
|
||||
setHideOnButtonClick(true);
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 636 B |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue