Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget@99624 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
342555fad2
commit
d406e0371a
|
@ -53,8 +53,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
private String reason;
|
||||
private String details;
|
||||
|
||||
|
||||
protected boolean backgroundBtnEnabled=true;
|
||||
protected ToolButton backgroundBtn;
|
||||
|
||||
protected ArrayList<MonitorDialogListener> listeners = new ArrayList<MonitorDialogListener>();
|
||||
|
@ -69,7 +67,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
initWindow();
|
||||
create();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void initWindow() {
|
||||
|
@ -90,32 +87,36 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
panel.setBodyBorder(false);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
/*FlowLayoutContainer progressDetailContainer = new FlowLayoutContainer();
|
||||
progressDetailContainer.setScrollMode(ScrollMode.AUTO);
|
||||
MarginData layoutData = new MarginData(new Margins(5, 5, 5, 5));*/
|
||||
|
||||
/*
|
||||
* FlowLayoutContainer progressDetailContainer = new
|
||||
* FlowLayoutContainer();
|
||||
* progressDetailContainer.setScrollMode(ScrollMode.AUTO); MarginData
|
||||
* layoutData = new MarginData(new Margins(5, 5, 5, 5));
|
||||
*/
|
||||
|
||||
ProgressBar progressBar = new ProgressBar();
|
||||
progressBar.setWidth(PROGRESSWIDTH);
|
||||
|
||||
/*FieldSet detailsSet = new FieldSet();
|
||||
detailsSet.setHeadingText("Details");
|
||||
detailsSet.setCollapsible(true);*/
|
||||
/*
|
||||
* FieldSet detailsSet = new FieldSet();
|
||||
* detailsSet.setHeadingText("Details");
|
||||
* detailsSet.setCollapsible(true);
|
||||
*/
|
||||
|
||||
monitorDetailPanel = new MonitorDetailPanel(eventBus);
|
||||
// detailsSet.add(monitorDetailPanel);
|
||||
|
||||
/*TextField
|
||||
|
||||
FlowLayoutContainer progressDetailContainer = new FlowLayoutContainer();
|
||||
progressDetailContainer.setScrollMode(ScrollMode.ALWAYS);
|
||||
MarginData layoutData = new MarginData(new Margins(0, 5, 0, 0));
|
||||
c.add(new TextButton("Button 1"), layoutData);
|
||||
c.add(new TextButton("Button 2"), layoutData);
|
||||
c.add(new TextButton("Button 3"), layoutData);
|
||||
Viewport v = new Viewport();
|
||||
v.add(c);
|
||||
RootPanel.get().add(v);
|
||||
/*
|
||||
* TextField
|
||||
*
|
||||
* FlowLayoutContainer progressDetailContainer = new
|
||||
* FlowLayoutContainer();
|
||||
* progressDetailContainer.setScrollMode(ScrollMode.ALWAYS); MarginData
|
||||
* layoutData = new MarginData(new Margins(0, 5, 0, 0)); c.add(new
|
||||
* TextButton("Button 1"), layoutData); c.add(new
|
||||
* TextButton("Button 2"), layoutData); c.add(new
|
||||
* TextButton("Button 3"), layoutData); Viewport v = new Viewport();
|
||||
* v.add(c); RootPanel.get().add(v);
|
||||
*/
|
||||
|
||||
btnOk = new TextButton("Ok");
|
||||
|
@ -124,7 +125,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
// btnOk.setIconAlign(IconAlign.RIGHT);
|
||||
btnOk.setTitle("Ok");
|
||||
|
||||
|
||||
btnOk.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
@ -139,7 +139,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
// btnBackground.setIconAlign(IconAlign.RIGHT);
|
||||
btnBackground.setTitle("Background");
|
||||
|
||||
|
||||
btnBackground.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
@ -147,17 +146,14 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
btnAbort = new TextButton("Abort");
|
||||
btnAbort.setWidth("70px");
|
||||
// btnAbort.setIcon(ResourceBundle.INSTANCE.abort());
|
||||
// btnAbort.setIconAlign(IconAlign.RIGHT);
|
||||
btnAbort.setTitle("Abort");
|
||||
|
||||
|
||||
btnAbort.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
@ -166,32 +162,32 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
||||
flowButton.add(btnOk, new BoxLayoutData(new Margins(0, 4, 0, 4)));
|
||||
flowButton.add(btnBackground, new BoxLayoutData(new Margins(0, 4, 0, 4)));
|
||||
flowButton.add(btnBackground,
|
||||
new BoxLayoutData(new Margins(0, 4, 0, 4)));
|
||||
flowButton.add(btnAbort, new BoxLayoutData(new Margins(0, 4, 0, 4)));
|
||||
|
||||
|
||||
v.add(progressBar,
|
||||
new VerticalLayoutData(1, -1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
v.add(monitorDetailPanel,new VerticalLayoutData(1, -1, new Margins(5, 5, 5, 5)));
|
||||
|
||||
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||
v.add(progressBar, new VerticalLayoutData(1, -1,
|
||||
new Margins(5, 5, 5, 5)));
|
||||
|
||||
/*progressDetailContainer.add(progressBar, layoutData);
|
||||
progressDetailContainer.add(monitorDetailPanel, layoutData);*/
|
||||
v.add(monitorDetailPanel, new VerticalLayoutData(1, -1, new Margins(5,
|
||||
5, 5, 5)));
|
||||
|
||||
v.add(flowButton,
|
||||
new VerticalLayoutData(1, 36, new Margins(5, 5, 5, 5)));
|
||||
|
||||
/*
|
||||
* progressDetailContainer.add(progressBar, layoutData);
|
||||
* progressDetailContainer.add(monitorDetailPanel, layoutData);
|
||||
*/
|
||||
|
||||
panel.add(v);
|
||||
add(panel);
|
||||
|
||||
|
||||
|
||||
OperationMonitorSession operationMonitorSession = new OperationMonitorSession(
|
||||
taskId);
|
||||
progressUpdater = new MonitorUpdater(operationMonitorSession);
|
||||
|
@ -212,6 +208,7 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
fireRequestAborted();
|
||||
}
|
||||
|
||||
|
||||
protected void startBackground() {
|
||||
// TODO Auto-generated method stub
|
||||
btnOk.setEnabled(false);
|
||||
|
@ -221,6 +218,38 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
close();
|
||||
}
|
||||
|
||||
public boolean isAbortBtnEnabled() {
|
||||
if (btnAbort != null) {
|
||||
return btnAbort.isEnabled();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAbortBtnEnabled(boolean abortBtnEnabled) {
|
||||
if (btnBackground != null) {
|
||||
btnBackground.setEnabled(abortBtnEnabled);
|
||||
btnBackground.setVisible(abortBtnEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean isBackgroundBtnEnabled() {
|
||||
if (btnBackground != null) {
|
||||
return btnBackground.isEnabled();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setBackgroundBtnEnabled(boolean backgroundBtnEnabled) {
|
||||
if (btnBackground != null) {
|
||||
btnBackground.setEnabled(backgroundBtnEnabled);
|
||||
btnBackground.setVisible(backgroundBtnEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
public void addProgressDialogListener(MonitorDialogListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
@ -229,15 +258,16 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
public void addMonitorDialogEventUIListener(MonitorDialogEventUIListener listener) {
|
||||
public void addMonitorDialogEventUIListener(
|
||||
MonitorDialogEventUIListener listener) {
|
||||
monitorDialogEventUIListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeMonitorDialogEventUIListener(MonitorDialogEventUIListener listener) {
|
||||
public void removeMonitorDialogEventUIListener(
|
||||
MonitorDialogEventUIListener listener) {
|
||||
monitorDialogEventUIListeners.remove(listener);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void monitorInitializing(OperationMonitor operationMonitor) {
|
||||
if (monitorDetailPanel != null) {
|
||||
|
@ -270,7 +300,8 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void monitorFailed(Throwable caught, String reason, String details, OperationMonitor operationMonitor) {
|
||||
public void monitorFailed(Throwable caught, String reason, String details,
|
||||
OperationMonitor operationMonitor) {
|
||||
if (monitorDetailPanel != null) {
|
||||
monitorDetailPanel.update(operationMonitor);
|
||||
|
||||
|
@ -295,7 +326,8 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void monitorStopped(TRId trId, String reason, String details, OperationMonitor operationMonitor) {
|
||||
public void monitorStopped(TRId trId, String reason, String details,
|
||||
OperationMonitor operationMonitor) {
|
||||
if (monitorDetailPanel != null) {
|
||||
monitorDetailPanel.update(operationMonitor);
|
||||
}
|
||||
|
@ -327,8 +359,6 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
forceLayout();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void monitorAborted() {
|
||||
fireOperationAborted();
|
||||
|
@ -347,7 +377,8 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
listener.operationComplete(trId);
|
||||
}
|
||||
|
||||
protected void fireOperationFailed(Throwable caught, String reason, String details) {
|
||||
protected void fireOperationFailed(Throwable caught, String reason,
|
||||
String details) {
|
||||
for (MonitorDialogListener listener : listeners)
|
||||
listener.operationFailed(caught, reason, details);
|
||||
}
|
||||
|
@ -384,30 +415,25 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
|
|||
*/
|
||||
@Override
|
||||
protected void initTools() {
|
||||
/*if (backgroundBtnEnabled) {
|
||||
backgroundBtn = new ToolButton(ToolButton.CLOSE);
|
||||
backgroundBtn.setToolTip("Put in the background");
|
||||
backgroundBtn.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
hide();
|
||||
}
|
||||
});
|
||||
|
||||
header.addTool(backgroundBtn);
|
||||
}*/
|
||||
/*
|
||||
* if (backgroundBtnEnabled) { backgroundBtn = new
|
||||
* ToolButton(ToolButton.CLOSE);
|
||||
* backgroundBtn.setToolTip("Put in the background");
|
||||
* backgroundBtn.addSelectHandler(new SelectHandler() {
|
||||
*
|
||||
* @Override public void onSelect(SelectEvent event) { hide(); } });
|
||||
*
|
||||
* header.addTool(backgroundBtn); }
|
||||
*/
|
||||
|
||||
super.initTools();
|
||||
|
||||
closeBtn.setVisible(false);
|
||||
/*
|
||||
closeBtn.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
close();
|
||||
}
|
||||
});*/
|
||||
* closeBtn.addSelectHandler(new SelectHandler() {
|
||||
*
|
||||
* public void onSelect(SelectEvent event) { close(); } });
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue