Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@90470 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-01-24 10:45:51 +00:00
parent bba30e3bc0
commit ca7f76b5e6
8 changed files with 109 additions and 41 deletions

View File

@ -158,3 +158,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...
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 10.68 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

View File

@ -4,6 +4,12 @@
<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>
<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>

View File

@ -2,9 +2,11 @@ package org.gcube.portlets.user.td.columnwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
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;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
@ -38,13 +40,15 @@ import com.sencha.gxt.widget.core.client.info.Info;
public class ChangeColumnTypePanel extends FramedPanel {
protected String WIDTH = "640px";
protected String HEIGHT = "520px";
protected ChangeColumnTypeDialog parent;
protected TextField label=null;
protected TextField label = null;
protected TRId trId;
protected String columnName;
protected ColumnData column;
protected ComboBox<ColumnData> combo=null;
protected ComboBox<ColumnData> comboColumn = null;
protected ComboBox<ColumnTypeCode> comboTypeColumn = null;
public ChangeColumnTypePanel(TRId trId, String columnName){
@ -76,9 +80,8 @@ public class ChangeColumnTypePanel extends FramedPanel {
Log.trace("Loader created");
combo = new ComboBox<ColumnData>(store,
props.label()){
@Override
comboColumn = new ComboBox<ColumnData>(store, props.label()){
protected void onAfterFirstAttach() {
super.onAfterFirstAttach();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@ -90,21 +93,28 @@ public class ChangeColumnTypePanel extends FramedPanel {
};
Log.trace("Combo created");
addHandlersForEventObservation(combo, props.label());
addHandlersForEventObservation(comboColumn, props.label());
combo.setEmptyText("Select a column...");
combo.setWidth(150);
combo.setTypeAhead(true);
combo.setTriggerAction(TriggerAction.ALL);
combo.setLoader(loader);
comboColumn.setEmptyText("Select a column...");
comboColumn.setWidth(150);
comboColumn.setTypeAhead(true);
comboColumn.setTriggerAction(TriggerAction.ALL);
comboColumn.setLoader(loader);
FramedPanel form = new FramedPanel();
form.setHeaderVisible(false);
//form.setWidth(350);
form.setBodyStyle("background: none;");
TextField labelColumn=new TextField();
VerticalLayoutContainer v = new VerticalLayoutContainer();
v.add(new FieldLabel(combo, "Column"), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(labelColumn, "Label"), new VerticalLayoutData(1, -1));
form.add(v);
form.addButton(new TextButton("Change"));
@ -126,7 +136,7 @@ public class ChangeColumnTypePanel extends FramedPanel {
+ (event.getValue() == null ? "nothing"
: labelProvider.getLabel(event
.getValue()) + "!"));
}
});
combo.addSelectionHandler(new SelectionHandler<T>() {
@ -140,37 +150,34 @@ public class ChangeColumnTypePanel extends FramedPanel {
}
});
}
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
TDGWTServiceAsync.INSTANCE.getColumns(trId, new AsyncCallback<ArrayList<ColumnData>>(){
TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
Log.error("load combo failure:"+caught.getLocalizedMessage());
callback.onFailure(caught);
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " ColumnData");
if(columnName!=null){
for(ColumnData cd: result){
if(cd.getName().compareTo(columnName)==0){
combo.setValue(cd);
}
public void onFailure(Throwable caught) {
Log.error("load combo failure:"
+ caught.getLocalizedMessage());
callback.onFailure(caught);
}
}
callback.onSuccess(new ListLoadResultBean<ColumnData>(
result));
}
});
public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " ColumnData");
if (columnName != null) {
for (ColumnData cd : result) {
if (cd.getName().compareTo(columnName) == 0) {
comboColumn.setValue(cd);
}
}
}
callback.onSuccess(new ListLoadResultBean<ColumnData>(
result));
}
});
}
}

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
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;

View File

@ -2,6 +2,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
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;

View File

@ -2,6 +2,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
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;

View File

@ -1,4 +1,4 @@
package org.gcube.portlets.user.td.columnwidget.client;
package org.gcube.portlets.user.td.columnwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;

View File

@ -0,0 +1,20 @@
package org.gcube.portlets.user.td.columnwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnTypeCode;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
public interface ColumnTypeCodeProperties extends
PropertyAccess<ColumnTypeCode> {
@Path("id")
ModelKeyProvider<String> id();
LabelProvider<String> label();
}