use of org.eclipse.jface.dialogs.ProgressIndicator in project cubrid-manager by CUBRID.
the class ExportDataViewPart method createPartControl.
/**
* Create part controls
*
* @param parent of the controls
*
*/
public void createPartControl(Composite parent) {
Composite backPanel = new Composite(parent, SWT.NONE);
backPanel.setLayout(new GridLayout(1, false));
backPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Composite progressPanel = new Composite(backPanel, SWT.NONE);
progressPanel.setLayout(new GridLayout(2, false));
progressPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
progressIndicator = new ProgressIndicator(progressPanel, SWT.NONE);
progressIndicator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
btnStop = new Button(progressPanel, SWT.NONE);
btnStop.setText(com.cubrid.common.ui.common.Messages.btnStop);
btnStop.setImage(CommonUIPlugin.getImage("icons/queryeditor/query_run_stop.png"));
btnStop.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
processStop();
}
});
tvProgress = new TableViewer(backPanel, SWT.BORDER | SWT.FULL_SELECTION);
tvProgress.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
tvProgress.getTable().setLinesVisible(true);
tvProgress.getTable().setHeaderVisible(true);
final TableViewerColumn tableName = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn totalCount = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn parseCount = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn status = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn elapsedTime = new TableViewerColumn(tvProgress, SWT.NONE);
tableName.getColumn().setWidth(250);
tableName.getColumn().setText(Messages.exportMonitorPartColumnFileName);
totalCount.getColumn().setWidth(100);
totalCount.getColumn().setText(Messages.exportMonitorPartColumnTotalcount);
parseCount.getColumn().setWidth(100);
parseCount.getColumn().setText(Messages.exportMonitorPartColumnParsecount);
status.getColumn().setWidth(100);
status.getColumn().setText(com.cubrid.common.ui.common.Messages.columnStatus);
elapsedTime.getColumn().setWidth(130);
elapsedTime.getColumn().setText(com.cubrid.common.ui.common.Messages.columnElapsedTime);
tvProgress.setContentProvider(new TableContentProvider());
tvProgress.setLabelProvider(new TableLabelProvider());
Composite historyComposite = new Composite(backPanel, SWT.NONE);
historyComposite.setLayout(new GridLayout(4, false));
historyComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
historyLabel = new Label(historyComposite, SWT.NONE);
historyLabel.setText(Messages.exportMonitorPartSaveLabel);
historyText = new Text(historyComposite, SWT.BORDER);
historyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
saveButton = new Button(historyComposite, SWT.NONE);
saveButton.setText(Messages.exportMonitorPartSaveButton);
saveButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (StringUtil.isEmpty(historyText.getText())) {
CommonUITool.openErrorBox(Messages.exportMonitorPartSaveErrMsg1);
return;
}
if (ExportConfigManager.getInstance().getConfig(historyText.getText()) != null) {
CommonUITool.openErrorBox(Messages.exportMonitorPartSaveErrMsg2);
return;
}
exportConfig.setName(historyText.getText().trim());
ExportConfigManager.getInstance().addConfig(exportConfig);
close();
}
});
closeButton = new Button(historyComposite, SWT.NONE);
closeButton.setText(Messages.closeButtonName);
closeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
close();
}
});
setHistroyWidgetStatus(false);
init();
}
use of org.eclipse.jface.dialogs.ProgressIndicator in project cubrid-manager by CUBRID.
the class TableContentProvider method createPartControl.
/**
* Create part controls
*
* @param parent of the controls
*
*/
public void createPartControl(Composite parent) {
Composite backPanel = new Composite(parent, SWT.NONE);
backPanel.setLayout(new GridLayout(1, false));
backPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Composite progressPanel = new Composite(backPanel, SWT.NONE);
progressPanel.setLayout(new GridLayout(3, false));
progressPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
progressIndicator = new ProgressIndicator(progressPanel, SWT.NONE);
progressIndicator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
btnStop = new Button(progressPanel, SWT.NONE);
btnStop.setText(Messages.btnStop);
btnStop.setImage(CommonUIPlugin.getImage("icons/queryeditor/query_run_stop.png"));
btnStop.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
processStop();
}
});
openLogFolderButton = new Button(progressPanel, SWT.NONE);
openLogFolderButton.setText(Messages.runSQLOpenBtn);
openLogFolderButton.setEnabled(false);
openLogFolderButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
java.awt.Desktop.getDesktop().open(new File(importConfig.getErrorLogFolderPath()));
} catch (IOException e) {
e.printStackTrace();
}
}
});
progressTableViewer = new TableViewer(backPanel, SWT.BORDER | SWT.FULL_SELECTION);
progressTableViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
progressTableViewer.getTable().setLinesVisible(true);
progressTableViewer.getTable().setHeaderVisible(true);
final TableViewerColumn tableName = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn totalCount = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn parseCount = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn failedCount = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn status = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn elapsedTime = new TableViewerColumn(progressTableViewer, SWT.NONE);
final TableViewerColumn buttonColumn = new TableViewerColumn(progressTableViewer, SWT.NONE);
tableName.getColumn().setWidth(250);
tableName.getColumn().setText(Messages.columnName);
totalCount.getColumn().setWidth(100);
totalCount.getColumn().setText(Messages.columnCount);
parseCount.getColumn().setWidth(100);
parseCount.getColumn().setText(Messages.columnFinished);
failedCount.getColumn().setWidth(100);
failedCount.getColumn().setText(Messages.columnFailed);
status.getColumn().setWidth(100);
status.getColumn().setText(Messages.columnStatus);
elapsedTime.getColumn().setWidth(130);
elapsedTime.getColumn().setText(Messages.columnTime);
buttonColumn.getColumn().setWidth(90);
progressTableViewer.setContentProvider(new TableContentProvider());
progressTableViewer.setLabelProvider(new TableLabelProvider());
progressTableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
ImportMonitor monitor = (ImportMonitor) selection.getFirstElement();
openViewDialog(monitor);
}
});
Composite historyComposite = new Composite(backPanel, SWT.NONE);
historyComposite.setLayout(new GridLayout(4, false));
historyComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
historyLabel = new Label(historyComposite, SWT.NONE);
historyLabel.setText(Messages.lblHistory);
historyText = new Text(historyComposite, SWT.BORDER);
historyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
saveButton = new Button(historyComposite, SWT.NONE);
saveButton.setText(Messages.btnSaveAndClose);
saveButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
if (historyText.getText().trim().length() == 0) {
CommonUITool.openErrorBox(Messages.errHistoryEmpty);
return;
}
if (ImportConfigManager.getInstance().getConfig(historyText.getText()) != null) {
CommonUITool.openErrorBox(Messages.errHistoryExist);
return;
}
importConfig.setName(historyText.getText().trim());
ImportConfigManager.getInstance().addConfig(importConfig);
close();
}
});
closeButton = new Button(historyComposite, SWT.NONE);
closeButton.setText(Messages.btnClose);
closeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
close();
}
});
setHistroyWidgetStatus(false);
init();
}
use of org.eclipse.jface.dialogs.ProgressIndicator in project cubrid-manager by CUBRID.
the class TableContentProvider method createPartControl.
/**
* Create part controls
*
* @param parent of the controls
*
*/
public void createPartControl(Composite parent) {
Composite backPanel = new Composite(parent, SWT.NONE);
backPanel.setLayout(new GridLayout(1, false));
backPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Composite progressPanel = new Composite(backPanel, SWT.NONE);
progressPanel.setLayout(new GridLayout(2, false));
progressPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
progressIndicator = new ProgressIndicator(progressPanel, SWT.NONE);
progressIndicator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
btnStop = new Button(progressPanel, SWT.NONE);
btnStop.setText(com.cubrid.common.ui.common.Messages.btnStop);
btnStop.setImage(CommonUIPlugin.getImage("icons/queryeditor/query_run_stop.png"));
btnStop.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
processStop();
}
});
tvProgress = new TableViewer(backPanel, SWT.BORDER | SWT.FULL_SELECTION);
tvProgress.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
tvProgress.getTable().setLinesVisible(true);
tvProgress.getTable().setHeaderVisible(true);
final TableViewerColumn tableName = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn totalCount = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn parseCount = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn status = new TableViewerColumn(tvProgress, SWT.NONE);
final TableViewerColumn elapsedTime = new TableViewerColumn(tvProgress, SWT.NONE);
tableName.getColumn().setWidth(250);
tableName.getColumn().setText(Messages.exportMonitorPartColumnFileName);
totalCount.getColumn().setWidth(100);
totalCount.getColumn().setText(Messages.exportMonitorPartColumnTotalcount);
parseCount.getColumn().setWidth(100);
parseCount.getColumn().setText(Messages.exportMonitorPartColumnParsecount);
status.getColumn().setWidth(100);
status.getColumn().setText(com.cubrid.common.ui.common.Messages.columnStatus);
elapsedTime.getColumn().setWidth(130);
elapsedTime.getColumn().setText(com.cubrid.common.ui.common.Messages.columnElapsedTime);
tvProgress.setContentProvider(new TableContentProvider());
tvProgress.setLabelProvider(new TableLabelProvider());
init();
}
use of org.eclipse.jface.dialogs.ProgressIndicator in project tdi-studio-se by Talend.
the class SQLBuilderDialog method createButtonsForButtonBar.
/**
* Create contents of the button bar.
*
* @param parent
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
GridData data = new GridData(GridData.FILL_HORIZONTAL);
parent.setLayoutData(data);
// increment the number of columns in the button bar
GridLayout layout = (GridLayout) parent.getLayout();
layout.makeColumnsEqualWidth = false;
layout.numColumns = 4;
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
progressIndicator = new ProgressIndicator(parent);
progressIndicator.setLayoutData(gd);
gd = new GridData();
gd.widthHint = 200;
Label l = new Label(parent, SWT.NONE);
l.setLayoutData(gd);
// OK and Cancel buttons
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
Aggregations