Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@90130 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
74c879d953
commit
9156ce2ade
10
.project
10
.project
|
@ -20,11 +20,6 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
|
@ -40,6 +35,11 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.core.client.ValueProvider;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||
|
@ -14,10 +15,9 @@ public interface ColumnDataProperties extends
|
|||
ModelKeyProvider<ColumnData> id();
|
||||
|
||||
LabelProvider<ColumnData> label();
|
||||
|
||||
/*
|
||||
ValueProvider<ColumnData, String> name();
|
||||
|
||||
ValueProvider<ColumnData, String> name();
|
||||
/*
|
||||
ValueProvider<ColumnData, String> typeName();
|
||||
|
||||
ValueProvider<ColumnData, String> typeCode();
|
||||
|
|
|
@ -16,6 +16,8 @@ public class ColumnWidgetEntry implements EntryPoint {
|
|||
trId.setTableId("1");
|
||||
RemoveColumnDialog dialog=new RemoveColumnDialog(trId);
|
||||
dialog.show();
|
||||
ChangeLabelColumnDialog changeLabel=new ChangeLabelColumnDialog(trId);
|
||||
changeLabel.show();
|
||||
Log.info("Hello!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
|||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.widget.client.TextButton;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.data.client.loader.RpcProxy;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
|
@ -37,6 +38,8 @@ import com.sencha.gxt.widget.core.client.info.Info;
|
|||
|
||||
public class RemoveColumnDialog extends Window {
|
||||
protected TRId trId;
|
||||
protected ComboBox<ColumnData> combo=null;
|
||||
protected String columnName=null;
|
||||
|
||||
public RemoveColumnDialog(TRId trId) {
|
||||
create(trId, null);
|
||||
|
@ -48,14 +51,19 @@ public class RemoveColumnDialog extends Window {
|
|||
|
||||
protected void create(TRId trId, String columnName) {
|
||||
this.trId=trId;
|
||||
this.columnName=columnName;
|
||||
setBodyBorder(false);
|
||||
// getHeader().setIcon(Resources.IMAGES.side_list());
|
||||
setHeadingText("Remove Column");
|
||||
setWidth(400);
|
||||
setHeight(200);
|
||||
setHeight(120);
|
||||
setResizable(false);
|
||||
|
||||
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
|
||||
|
||||
ContentPanel panel = new ContentPanel();
|
||||
panel.setHeaderVisible(false);
|
||||
panel.setBodyStyle("margin: 0px;");
|
||||
|
||||
ColumnDataProperties props = GWT.create(ColumnDataProperties.class);
|
||||
ListStore<ColumnData> store = new ListStore<ColumnData>(props.id());
|
||||
|
@ -73,7 +81,7 @@ public class RemoveColumnDialog extends Window {
|
|||
Log.trace("Loader created");
|
||||
|
||||
|
||||
ComboBox<ColumnData> combo = new ComboBox<ColumnData>(store,
|
||||
combo = new ComboBox<ColumnData>(store,
|
||||
props.label()){
|
||||
@Override
|
||||
protected void onAfterFirstAttach() {
|
||||
|
@ -102,12 +110,12 @@ public class RemoveColumnDialog extends Window {
|
|||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
form.add(v);
|
||||
form.addButton(new TextButton("Remove"));
|
||||
v.add(new FieldLabel(combo, "Column"), new VerticalLayoutData(1, -1));
|
||||
|
||||
panel.add(form);
|
||||
panel.addButton(new TextButton("Remove"));
|
||||
|
||||
add(panel);
|
||||
basicLayout.add(panel, new VerticalLayoutData(-1, -1, new Margins()));
|
||||
add(basicLayout);
|
||||
|
||||
}
|
||||
|
||||
|
@ -152,6 +160,13 @@ public class RemoveColumnDialog extends Window {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
||||
result));
|
||||
|
||||
|
|
Loading…
Reference in New Issue