Search in sources :

Example 1 with ProgressIndicator

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) ProgressIndicator(org.eclipse.jface.dialogs.ProgressIndicator) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 2 with ProgressIndicator

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ImportMonitor(com.cubrid.common.ui.cubrid.table.dialog.imp.model.ImportMonitor) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) Text(org.eclipse.swt.widgets.Text) IOException(java.io.IOException) ITableLabelProvider(org.eclipse.jface.viewers.ITableLabelProvider) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) ProgressIndicator(org.eclipse.jface.dialogs.ProgressIndicator) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) File(java.io.File) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 3 with ProgressIndicator

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();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) ProgressIndicator(org.eclipse.jface.dialogs.ProgressIndicator) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ITableLabelProvider(org.eclipse.jface.viewers.ITableLabelProvider) TableViewer(org.eclipse.jface.viewers.TableViewer) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn)

Example 4 with ProgressIndicator

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);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ProgressIndicator(org.eclipse.jface.dialogs.ProgressIndicator) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Aggregations

ProgressIndicator (org.eclipse.jface.dialogs.ProgressIndicator)4 GridData (org.eclipse.swt.layout.GridData)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 TableViewer (org.eclipse.jface.viewers.TableViewer)3 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Button (org.eclipse.swt.widgets.Button)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 ITableLabelProvider (org.eclipse.jface.viewers.ITableLabelProvider)2 Text (org.eclipse.swt.widgets.Text)2 ImportMonitor (com.cubrid.common.ui.cubrid.table.dialog.imp.model.ImportMonitor)1 File (java.io.File)1 IOException (java.io.IOException)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1