Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@93792 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-28 17:42:23 +00:00
parent 27b026de26
commit 06e0051a77
3 changed files with 93 additions and 56 deletions

View File

@ -2150,3 +2150,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...
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
40% complete (ETR: 8 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 14.10 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

@ -12,7 +12,6 @@ import org.gcube.portlets.user.tdwx.client.event.FailureEvent;
import org.gcube.portlets.user.tdwx.client.event.FailureEventHandler;
import org.gcube.portlets.user.tdwx.shared.model.TableId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.core.client.Style.SelectionMode;
@ -30,43 +29,42 @@ import com.sencha.gxt.widget.core.client.info.Info;
public class DialogDimensionRowSelection extends Window {
protected static final int WIDTH = 550;
protected static final int HEIGHT = 520;
protected ColumnData column;
protected EventBus eventBus;
protected DimensionRow dimRow;
protected CellData cellData;
protected ArrayList<DimensionRowSelectionListener> listeners;
private static TabularDataX tabularData;
private TabularDataXGridPanel gridPanel;
private TextField value;
private TextButton select;
public DialogDimensionRowSelection(ColumnData column, CellData cellData, EventBus eventBus) {
this.column=column;
this.eventBus=eventBus;
this.cellData=cellData;
listeners=new ArrayList<DimensionRowSelectionListener>();
public DialogDimensionRowSelection(ColumnData column, CellData cellData,
EventBus eventBus) {
this.column = column;
this.eventBus = eventBus;
this.cellData = cellData;
listeners = new ArrayList<DimensionRowSelectionListener>();
initWindow();
create();
open();
}
protected void create(){
protected void create() {
final FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
value = new TextField();
value.setValue(cellData.getValue());
value.setReadOnly(true);
//Grid
// Grid
tabularData = new TabularDataX(Constants.TDX_DATASOURCE_FACTORY_ID);
tabularData.addFailureHandler(new FailureEventHandler() {
@ -77,13 +75,17 @@ public class DialogDimensionRowSelection extends Window {
}
});
gridPanel = tabularData.getGridPanel();
gridPanel.setHeaderVisible(false);
gridPanel.setSelectionModel(SelectionMode.SINGLE);
Log.debug("SetVisibleOnlyColumn");
gridPanel.setVisibleOnlyColumn(column.getColumnId());
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
v.add(gridPanel, new VerticalLayoutData(1, 1));
panel.add(v);
select = new TextButton("Select");
@ -100,52 +102,59 @@ public class DialogDimensionRowSelection extends Window {
add(panel);
forceLayout();
}
protected void startSelect(){
ArrayList<String> rowsId=gridPanel.getSelectedRowsId();
if(rowsId==null||rowsId.size()==0){
protected void startSelect() {
ArrayList<String> rowsId = gridPanel.getSelectedRowsId();
if (rowsId == null || rowsId.size() == 0) {
Log.debug("No row selected");
UtilsGXT3.alert("Attention",
"Select a row");
UtilsGXT3.alert("Attention", "Select a row");
} else {
String rowId=rowsId.get(0);
Log.debug("Row selected: "+rowId);
ArrayList<String> cellValues=gridPanel.getCellValue(column.getColumnId());
if(cellValues==null|| cellValues.size()==0){
String rowId = rowsId.get(0);
Log.debug("Row selected: " + rowId);
ArrayList<String> cellValues = gridPanel.getCellValue(column
.getColumnId());
if (cellValues == null || cellValues.size() == 0) {
Log.debug("No value retrieved");
UtilsGXT3.alert("Attention",
"Select a row");
UtilsGXT3.alert("Attention", "Select a row");
} else {
String cellValue=cellValues.get(0);
Log.debug("Retrived: "+ rowId+" "+cellValue);
dimRow=new DimensionRow(rowId,cellValue);
String cellValue = cellValues.get(0);
Log.debug("Retrived: " + rowId + " " + cellValue);
dimRow = new DimensionRow(rowId, cellValue);
fireCompleted(dimRow);
}
}
}
protected void open(){
long tableId=column.getColumnViewData().getTargetTableId();
}
protected void open() {
long tableId=0;
if (column.isViewColumn()) {
tableId = column.getColumnViewData().getTargetTableId();
} else {
tableId = Long.valueOf(column.getTrId().getTableId());
}
TableId tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
String.valueOf(tableId));
Log.debug("Open Table:"+tableId);
tabularData.openTable(tableOpening);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Dimension");
setClosable(true);
//getHeader().setIcon(ResourceBundle.INSTANCE.replace());
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Dimension");
setClosable(true);
// getHeader().setIcon(ResourceBundle.INSTANCE.replace());
}
/**
* {@inheritDoc}
*/
@ -162,10 +171,7 @@ public class DialogDimensionRowSelection extends Window {
});
}
public void addListener(DimensionRowSelectionListener listener) {
listeners.add(listener);
}
@ -192,6 +198,4 @@ public class DialogDimensionRowSelection extends Window {
hide();
}
}

View File

@ -101,7 +101,8 @@ public class ReplacePanel extends FramedPanel implements
public void onSuccess(ColumnData result) {
Log.debug("Retrived column: " + result);
column = result;
if (result.isViewColumn()) {
if (result.isViewColumn() || column.getTypeCode().compareTo("TIMEDIMENSION")==0
|| column.getTypeCode().compareTo("DIMENSION")==0) {
/*
* UtilsGXT3 .info("View Column",
* "You can not replace value on view column for now"