Fixed Layout for GXT 3.1.1
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@101952 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
dff54ac883
commit
9010e76d76
|
@ -93,11 +93,13 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
private ChangeColumnTypeDialog parent;
|
private ChangeColumnTypeDialog parent;
|
||||||
private TRId trId;
|
private TRId trId;
|
||||||
private String columnName;
|
private String columnName;
|
||||||
private ColumnData columnChangeType;
|
private ColumnData sourceColumnChangeType;
|
||||||
private ColumnData columnRequested;
|
private ColumnData columnRequested;
|
||||||
private ColumnData connectionColumn;
|
private ColumnData connectionColumn;
|
||||||
private ComboBox<ColumnData> comboColumn = null;
|
private ComboBox<ColumnData> comboColumn = null;
|
||||||
|
|
||||||
private ComboBox<ColumnTypeCodeElement> comboColumnTypeCode = null;
|
private ComboBox<ColumnTypeCodeElement> comboColumnTypeCode = null;
|
||||||
|
private FieldLabel comboColumnTypeCodeLabel;
|
||||||
|
|
||||||
private ComboBox<ColumnDataTypeElement> comboMeasureType = null;
|
private ComboBox<ColumnDataTypeElement> comboMeasureType = null;
|
||||||
private FieldLabel comboMeasureTypeLabel;
|
private FieldLabel comboMeasureTypeLabel;
|
||||||
|
@ -140,7 +142,13 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
this.columnName = columnName;
|
this.columnName = columnName;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
panelCreated = false;
|
panelCreated = false;
|
||||||
retrieveColumnRequested();
|
|
||||||
|
if (columnName != null && !columnName.isEmpty()) {
|
||||||
|
retrieveColumnRequested();
|
||||||
|
} else {
|
||||||
|
panelCreated = true;
|
||||||
|
create();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void retrieveColumnRequested() {
|
protected void retrieveColumnRequested() {
|
||||||
|
@ -271,6 +279,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboColumnTypeCode.setTypeAhead(true);
|
comboColumnTypeCode.setTypeAhead(true);
|
||||||
comboColumnTypeCode.setTriggerAction(TriggerAction.ALL);
|
comboColumnTypeCode.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
|
comboColumnTypeCodeLabel = new FieldLabel(comboColumnTypeCode,
|
||||||
|
"Column Type");
|
||||||
// comboMeasureType
|
// comboMeasureType
|
||||||
ColumnDataTypeProperties propsMeasureType = GWT
|
ColumnDataTypeProperties propsMeasureType = GWT
|
||||||
.create(ColumnDataTypeProperties.class);
|
.create(ColumnDataTypeProperties.class);
|
||||||
|
@ -446,8 +456,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
||||||
-1, new Margins(1)));
|
-1, new Margins(1)));
|
||||||
v.add(new FieldLabel(comboColumnTypeCode, "Column Type"),
|
v.add(comboColumnTypeCodeLabel, new VerticalLayoutData(1, -1,
|
||||||
new VerticalLayoutData(1, -1, new Margins(1)));
|
new Margins(1)));
|
||||||
v.add(comboLocaleTypeLabel, new VerticalLayoutData(1, -1,
|
v.add(comboLocaleTypeLabel, new VerticalLayoutData(1, -1,
|
||||||
new Margins(1)));
|
new Margins(1)));
|
||||||
v.add(comboMeasureTypeLabel, new VerticalLayoutData(1, -1, new Margins(
|
v.add(comboMeasureTypeLabel, new VerticalLayoutData(1, -1, new Margins(
|
||||||
|
@ -467,6 +477,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||||
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
|
||||||
|
resetToInitialState();
|
||||||
|
|
||||||
|
// addButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void resetToInitialState() {
|
||||||
comboMeasureTypeLabel.setVisible(false);
|
comboMeasureTypeLabel.setVisible(false);
|
||||||
comboAttributeTypeLabel.setVisible(false);
|
comboAttributeTypeLabel.setVisible(false);
|
||||||
comboDimensionTypeLabel.setVisible(false);
|
comboDimensionTypeLabel.setVisible(false);
|
||||||
|
@ -474,8 +490,6 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboColumnMappingLabel.setVisible(false);
|
comboColumnMappingLabel.setVisible(false);
|
||||||
comboTimeDimensionTypeLabel.setVisible(false);
|
comboTimeDimensionTypeLabel.setVisible(false);
|
||||||
comboLocaleTypeLabel.setVisible(false);
|
comboLocaleTypeLabel.setVisible(false);
|
||||||
|
|
||||||
// addButton();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addHandlersForComboColumn(
|
protected void addHandlersForComboColumn(
|
||||||
|
@ -620,7 +634,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
+ "!"));
|
+ "!"));
|
||||||
Log.debug("ComboColumnReferenceType selected: "
|
Log.debug("ComboColumnReferenceType selected: "
|
||||||
+ event.getSelectedItem());
|
+ event.getSelectedItem());
|
||||||
|
ColumnData columnReference = event.getSelectedItem();
|
||||||
|
updateConfBtnChange(columnReference);
|
||||||
// TODO Mapping fix
|
// TODO Mapping fix
|
||||||
/*
|
/*
|
||||||
* comboColumnMapping.reset();
|
* comboColumnMapping.reset();
|
||||||
|
@ -804,15 +819,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
protected void setComboStatus(ArrayList<ColumnData> result) {
|
protected void setComboStatus(ArrayList<ColumnData> result) {
|
||||||
Log.debug("ColumnRequested: " + columnRequested);
|
Log.debug("ColumnRequested: " + columnRequested);
|
||||||
String columnId;
|
|
||||||
|
|
||||||
if (columnRequested.isViewColumn()) {
|
|
||||||
columnId = columnRequested.getColumnViewData()
|
|
||||||
.getSourceTableDimensionColumnId();
|
|
||||||
} else {
|
|
||||||
columnId = columnRequested.getColumnId();
|
|
||||||
}
|
|
||||||
if (columnRequested != null) {
|
if (columnRequested != null) {
|
||||||
|
String columnId;
|
||||||
|
if (columnRequested.isViewColumn()) {
|
||||||
|
columnId = columnRequested.getColumnViewData()
|
||||||
|
.getSourceTableDimensionColumnId();
|
||||||
|
} else {
|
||||||
|
columnId = columnRequested.getColumnId();
|
||||||
|
}
|
||||||
|
|
||||||
for (ColumnData cd : result) {
|
for (ColumnData cd : result) {
|
||||||
Log.debug("Column:" + cd.getColumnId());
|
Log.debug("Column:" + cd.getColumnId());
|
||||||
if (cd.getColumnId().compareTo(columnId) == 0) {
|
if (cd.getColumnId().compareTo(columnId) == 0) {
|
||||||
|
@ -820,15 +835,20 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
change.disable();
|
||||||
|
comboColumnTypeCode.reset();
|
||||||
|
comboColumnTypeCodeLabel.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateComboStatus(ColumnData cd) {
|
protected void updateComboStatus(ColumnData cd) {
|
||||||
columnChangeType = cd;
|
sourceColumnChangeType = cd;
|
||||||
Log.debug("Update Combos ColumnData: " + cd.toString());
|
Log.debug("Update Combos ColumnData: " + cd);
|
||||||
changeColumnTypeSession = new ChangeColumnTypeSession();
|
changeColumnTypeSession = new ChangeColumnTypeSession();
|
||||||
changeColumnTypeSession.setColumnData(cd);
|
changeColumnTypeSession.setColumnData(cd);
|
||||||
comboColumn.setValue(cd);
|
comboColumn.setValue(cd);
|
||||||
|
comboColumnTypeCodeLabel.setVisible(true);
|
||||||
comboColumnTypeCode.setValue(ColumnTypeCodeStore.selectedElement(cd
|
comboColumnTypeCode.setValue(ColumnTypeCodeStore.selectedElement(cd
|
||||||
.getTypeCode()));
|
.getTypeCode()));
|
||||||
ColumnTypeCode type = ColumnTypeCodeStore.selected(cd.getTypeCode());
|
ColumnTypeCode type = ColumnTypeCodeStore.selected(cd.getTypeCode());
|
||||||
|
@ -887,7 +907,23 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
public void update(TRId trId, String columnName) {
|
public void update(TRId trId, String columnName) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.columnName = columnName;
|
this.columnName = columnName;
|
||||||
retrieveColumnRequested();
|
|
||||||
|
if (columnName != null && !columnName.isEmpty()) {
|
||||||
|
retrieveColumnRequested();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
columnRequested = null;
|
||||||
|
comboColumn.reset();
|
||||||
|
comboDimensionType.clear();
|
||||||
|
resetToInitialState();
|
||||||
|
// Reset comboDimensionType
|
||||||
|
comboDimensionType.reset();
|
||||||
|
comboDimensionType.clear();
|
||||||
|
storeComboDimensionType.commitChanges();
|
||||||
|
|
||||||
|
loader.load();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void retrieveConnectionForViewColumn(RefColumn refCol) {
|
protected void retrieveConnectionForViewColumn(RefColumn refCol) {
|
||||||
|
@ -930,6 +966,28 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void updateConfBtnChange(ColumnData columnReference) {
|
||||||
|
if (connectionColumn == null) {
|
||||||
|
if (columnReference != null) {
|
||||||
|
change.enable();
|
||||||
|
} else {
|
||||||
|
change.disable();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (columnReference == null) {
|
||||||
|
change.disable();
|
||||||
|
} else {
|
||||||
|
if (columnReference.getColumnId().compareTo(
|
||||||
|
connectionColumn.getColumnId()) == 0) {
|
||||||
|
change.disable();
|
||||||
|
} else {
|
||||||
|
change.enable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void updateConfBtnChange(ColumnTypeCode columnTypeCode) {
|
protected void updateConfBtnChange(ColumnTypeCode columnTypeCode) {
|
||||||
if (columnTypeCode == null) {
|
if (columnTypeCode == null) {
|
||||||
ColumnTypeCodeElement codeElement = comboColumnTypeCode.getValue();
|
ColumnTypeCodeElement codeElement = comboColumnTypeCode.getValue();
|
||||||
|
@ -946,8 +1004,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
// TODO
|
// TODO
|
||||||
protected void configureBtnChange(ColumnTypeCode columnTypeCode) {
|
protected void configureBtnChange(ColumnTypeCode columnTypeCode) {
|
||||||
ColumnTypeCode sourceTypeCode = ColumnTypeMap
|
ColumnTypeCode sourceTypeCode = ColumnTypeMap
|
||||||
.getColumnTypeCode(columnChangeType.getTypeCode());
|
.getColumnTypeCode(sourceColumnChangeType.getTypeCode());
|
||||||
|
|
||||||
|
|
||||||
switch (sourceTypeCode) {
|
switch (sourceTypeCode) {
|
||||||
case ANNOTATION:
|
case ANNOTATION:
|
||||||
|
|
|
@ -10,7 +10,8 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Row
|
* Dialog to create a column definition
|
||||||
|
* used in extract codelist widget
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi"
|
* @author "Giancarlo Panichi"
|
||||||
*
|
*
|
||||||
|
|
|
@ -236,8 +236,9 @@ public class CreateDefColumnPanel extends FramedPanel {
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
|
|
||||||
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnSave, boxLayoutData);
|
||||||
|
flowButton.add(btnClose, boxLayoutData);
|
||||||
|
|
||||||
VerticalLayoutContainer vPanel = new VerticalLayoutContainer();
|
VerticalLayoutContainer vPanel = new VerticalLayoutContainer();
|
||||||
vPanel.add(form, new VerticalLayoutData(1, -1));
|
vPanel.add(form, new VerticalLayoutData(1, -1));
|
||||||
|
|
|
@ -152,13 +152,14 @@ public class ConnectCodelistDialog extends Window implements
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
|
|
||||||
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnApply, boxLayoutData);
|
||||||
|
flowButton.add(btnClose, boxLayoutData);
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(comboDimensionTypeLabel, new VerticalLayoutData(1, -1));
|
v.add(comboDimensionTypeLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1));
|
v.add(comboColumnReferenceTypeLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(flowButton, new VerticalLayoutData(-1, 36,
|
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||||
new Margins(5, 2, 5, 2)));
|
new Margins(5, 2, 5, 2)));
|
||||||
|
|
||||||
panel.add(v);
|
panel.add(v);
|
||||||
|
@ -290,8 +291,10 @@ public class ConnectCodelistDialog extends Window implements
|
||||||
storeComboColumnReferenceType.clear();
|
storeComboColumnReferenceType.clear();
|
||||||
storeComboColumnReferenceType.addAll(result);
|
storeComboColumnReferenceType.addAll(result);
|
||||||
storeComboColumnReferenceType.commitChanges();
|
storeComboColumnReferenceType.commitChanges();
|
||||||
|
|
||||||
comboColumnReferenceTypeLabel.setVisible(true);
|
comboColumnReferenceTypeLabel.setVisible(true);
|
||||||
comboColumnReferenceType.setMinListWidth(191);
|
comboColumnReferenceType.setMinListWidth(191);
|
||||||
|
comboColumnReferenceTypeLabel.forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -203,8 +203,10 @@ public class ReplacePanel extends FramedPanel implements
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
|
|
||||||
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
|
||||||
|
flowButton.add(btnApply, boxLayoutData);
|
||||||
|
flowButton.add(btnClose, boxLayoutData);
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
if (column.getDataTypeName().compareTo("Date") == 0) {
|
if (column.getDataTypeName().compareTo("Date") == 0) {
|
||||||
|
@ -217,7 +219,7 @@ public class ReplacePanel extends FramedPanel implements
|
||||||
v.add(new FieldLabel(replaceValue, "Replace"),
|
v.add(new FieldLabel(replaceValue, "Replace"),
|
||||||
new VerticalLayoutData(1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
}
|
}
|
||||||
v.add(flowButton, new VerticalLayoutData(-1, 36,
|
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||||
new Margins(5, 2, 5, 2)));
|
new Margins(5, 2, 5, 2)));
|
||||||
add(v);
|
add(v);
|
||||||
|
|
||||||
|
@ -279,13 +281,14 @@ public class ReplacePanel extends FramedPanel implements
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
|
|
||||||
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnApply, boxLayoutData);
|
||||||
|
flowButton.add(btnClose, boxLayoutData);
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
|
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
|
||||||
v.add(comboDimensionTypeLabel, new VerticalLayoutData(1, -1));
|
v.add(comboDimensionTypeLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(flowButton, new VerticalLayoutData(-1, 36,
|
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||||
new Margins(5, 2, 5, 2)));
|
new Margins(5, 2, 5, 2)));
|
||||||
add(v);
|
add(v);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue