Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@94786 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
523ce0c4ba
commit
dc7462c918
|
@ -83,7 +83,8 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
*
|
||||
*/
|
||||
public class ReplaceBatchPanel extends FramedPanel implements
|
||||
SingleValueReplaceListener, DimensionRowSelectionListener, ConnectCodelistListener {
|
||||
SingleValueReplaceListener, DimensionRowSelectionListener,
|
||||
ConnectCodelistListener {
|
||||
protected String WIDTH = "560px";
|
||||
protected String HEIGHT = "520px";
|
||||
protected EventBus eventBus;
|
||||
|
@ -102,17 +103,19 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
|
||||
private TextButton btnSave;
|
||||
private TextButton btnClose;
|
||||
private TextButton btnConnect;
|
||||
|
||||
private ToolBar toolBarHead;
|
||||
|
||||
private ComboBox<ShowOccurrencesTypeElement> comboShowOccurrencesType = null;
|
||||
|
||||
|
||||
|
||||
private TextButton btnConnect;
|
||||
private TextField connectionField;
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<ReplaceEntry>> loader;
|
||||
protected Grid<ReplaceEntry> grid;
|
||||
protected ListStore<ReplaceEntry> store;
|
||||
protected HTML info;
|
||||
private TextButton btnDisconnect;
|
||||
|
||||
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
|
||||
String columnName, EventBus eventBus) {
|
||||
|
@ -138,9 +141,9 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
protected void create() {
|
||||
showOccurencesType = ShowOccurrencesType.ONLYERRORS;
|
||||
|
||||
ToolBar toolBarHead = new ToolBar();
|
||||
toolBarHead = new ToolBar();
|
||||
toolBarHead.add(new LabelToolItem("Show: "));
|
||||
|
||||
|
||||
// Create Combo Show
|
||||
ShowOccurrencesTypeProperties propsShowOccurrencesType = GWT
|
||||
.create(ShowOccurrencesTypeProperties.class);
|
||||
|
@ -165,10 +168,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
|
||||
toolBarHead.add(comboShowOccurrencesType);
|
||||
|
||||
//Connect Codelist
|
||||
btnConnect = new TextButton("Connect");
|
||||
btnConnect.setIcon(ResourceBundle.INSTANCE.codelistLink());
|
||||
btnConnect.setIconAlign(IconAlign.RIGHT);
|
||||
// Connect Codelist
|
||||
btnConnect = new TextButton();
|
||||
btnConnect.setIcon(ResourceBundle.INSTANCE.codelistLink24());
|
||||
btnConnect.setIconAlign(IconAlign.TOP);
|
||||
btnConnect.setTitle("Connect");
|
||||
btnConnect.addSelectHandler(new SelectHandler() {
|
||||
|
||||
|
@ -179,10 +182,30 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
toolBarHead.add(btnConnect);
|
||||
|
||||
|
||||
toolBarHead.add(btnConnect, new BoxLayoutData(new Margins(10,0,0,0)));
|
||||
// Disconnect Codelist
|
||||
btnDisconnect = new TextButton();
|
||||
btnDisconnect.setIcon(ResourceBundle.INSTANCE.codelistLinkBreak24());
|
||||
btnDisconnect.setIconAlign(IconAlign.TOP);
|
||||
btnDisconnect.setTitle("Disconnect");
|
||||
btnDisconnect.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Disconnect");
|
||||
btnDisconnect.disable();
|
||||
disconnectCodelist();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
toolBarHead.add(btnDisconnect);
|
||||
|
||||
connectionField = new TextField();
|
||||
toolBarHead.add(connectionField);
|
||||
|
||||
// Create Grid
|
||||
IdentityValueProvider<ReplaceEntry> identity = new IdentityValueProvider<ReplaceEntry>();
|
||||
|
@ -355,10 +378,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
new Margins(5, 2, 5, 2)));
|
||||
add(v);
|
||||
|
||||
connectionField.setVisible(false);
|
||||
btnDisconnect.setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void retrieveColumn() {
|
||||
TDGWTServiceAsync.INSTANCE.getColumn(trId, columnName,
|
||||
|
@ -412,11 +435,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void addHandlersForShowOccurrencesType(
|
||||
final LabelProvider<ShowOccurrencesTypeElement> labelProvider) {
|
||||
comboShowOccurrencesType
|
||||
|
@ -449,7 +467,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
|
||||
|
||||
OccurrencesForReplaceBatchColumnSession occurrencesSession = new OccurrencesForReplaceBatchColumnSession(
|
||||
column, showOccurencesType,hasValidationColumns);
|
||||
column, showOccurencesType, hasValidationColumns);
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace(
|
||||
occurrencesSession,
|
||||
|
@ -561,7 +579,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
protected void startReplaceBatch(
|
||||
ArrayList<ReplaceEntry> effectiveReplaceList) {
|
||||
ReplaceBatchColumnSession replaceBatchColumnSession = new ReplaceBatchColumnSession(
|
||||
|
@ -615,7 +632,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void selectedSingleValueReplace(String replaceValue) {
|
||||
Log.debug("Change Value: " + replaceValue);
|
||||
|
@ -623,34 +639,47 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
store.update(currentReplaceEntry);
|
||||
updateInfo();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void abortedSingleValueReplace() {
|
||||
Log.debug("Change Value Aborted");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failedSingleValueReplace(String reason, String detail) {
|
||||
Log.error("Change Value Failed:" + reason + " " + detail);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void connectCodelist() {
|
||||
|
||||
protected void connectCodelist() {
|
||||
Log.debug("callConnectCodelistDialog");
|
||||
|
||||
ConnectCodelistDialog connectCodelistDialog = new ConnectCodelistDialog(
|
||||
eventBus);
|
||||
connectCodelistDialog.addListener(this);
|
||||
connectCodelistDialog.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void disconnectCodelist() {
|
||||
Log.debug("Disconnect codelist");
|
||||
connectionField.setValue("");
|
||||
connectionField.setVisible(false);
|
||||
btnDisconnect.setVisible(false);
|
||||
btnConnect.setVisible(true);
|
||||
btnConnect.enable();
|
||||
toolBarHead.forceLayout();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void selectedConnectCodelist(ColumnData connection) {
|
||||
Log.debug("Selected connection: "+connection);
|
||||
Log.debug("Selected connection: " + connection);
|
||||
connectionField.setValue(connection.getLabel());
|
||||
connectionField.setVisible(true);
|
||||
btnDisconnect.setVisible(true);
|
||||
btnConnect.setVisible(false);
|
||||
btnConnect.enable();
|
||||
toolBarHead.forceLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -661,11 +690,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
|
||||
@Override
|
||||
public void failedConnectCodelist(String reason, String detail) {
|
||||
Log.debug("Connection Failed: "+reason+" "+detail);
|
||||
UtilsGXT3.alert("Error on connect",
|
||||
reason);
|
||||
Log.debug("Connection Failed: " + reason + " " + detail);
|
||||
UtilsGXT3.alert("Error on connect", reason);
|
||||
btnConnect.enable();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue