Search in sources :

Example 71 with Table

use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.

the class BrokerStatusView method createBasicTable.

/**
	 * Create basic info table
	 * 
	 * @param comp the parent composite
	 * 
	 */
private void createBasicTable(Composite comp) {
    final Composite basicComposite = new Composite(comp, SWT.NONE);
    GridData gdBasic = new GridData(SWT.FILL, SWT.NONE, false, false);
    basicComposite.setLayoutData(gdBasic);
    basicComposite.setLayout(new GridLayout());
    basicTableViewer = new TableViewer(basicComposite, SWT.NO_SCROLL | SWT.BORDER);
    Table basicTable = basicTableViewer.getTable();
    basicTable.setHeaderVisible(true);
    basicTable.setLinesVisible(true);
    GridData tblBasic = new GridData(SWT.FILL, SWT.TOP, true, false);
    tblBasic.heightHint = CommonUITool.getHeightHintOfTable(basicTable);
    basicTable.setLayoutData(tblBasic);
    TableLayout basicLayout = new TableLayout();
    setBasicLayout(basicLayout);
    basicTable.setLayout(basicLayout);
    basicTable.setBackground(basicComposite.getBackground());
    TableColumn tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscPid);
    tblColumn.setToolTipText(Messages.tblBscPid);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscPort);
    tblColumn.setToolTipText(Messages.tblBscPort);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscJobQueue);
    tblColumn.setToolTipText(Messages.tblBscJobQueue);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscAutoAddAs);
    tblColumn.setToolTipText(Messages.tblBscAutoAddAs);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscSqlLogMode);
    tblColumn.setToolTipText(Messages.tblBscSqlLogMode);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscLongTranTime);
    tblColumn.setToolTipText(Messages.tblBscLongTranTime);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscLongQueryTime);
    tblColumn.setToolTipText(Messages.tblBscLongQueryTime);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscSessionTimeout);
    tblColumn.setToolTipText(Messages.tblBscSessionTimeout);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscKeepConn);
    tblColumn.setToolTipText(Messages.tblBscKeepConn);
    tblColumn = new TableColumn(basicTable, SWT.CENTER);
    tblColumn.setText(Messages.tblBscAccessMode);
    tblColumn.setToolTipText(Messages.tblBscAccessMode);
    basicTableViewer.setContentProvider(new BrokerBasicInfoContentProvider());
    ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
    BrokerBasicInfoLabelProvider basicInfoLabelProvider = new BrokerBasicInfoLabelProvider();
    basicInfoLabelProvider.setServerInfo(serverInfo);
    basicTableViewer.setLabelProvider(basicInfoLabelProvider);
    basicTableViewer.setInput(basicInfoLst);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ApplyServerInfo(com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 72 with Table

use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.

the class BackupDatabaseDialog method createBackupHistoryComp.

/**
	 *
	 * Create backup history information tab composite
	 *
	 * @return the composite
	 */
private Composite createBackupHistoryComp() {
    Composite composite = new Composite(tabFolder, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);
    Label tipLabel = new Label(composite, SWT.LEFT | SWT.WRAP);
    tipLabel.setText(Messages.msgBackupHistoryList);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    tipLabel.setLayoutData(gridData);
    final String[] columnNameArr = new String[] { Messages.tblColumnBackupLevel, Messages.tblColumnBackupDate, Messages.tblColumnSize, Messages.tblColumnBackupPath };
    TableViewer historyTableViewer = CommonUITool.createCommonTableViewer(composite, new TableViewerSorter(), columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, 400, 200));
    historyTableViewer.setInput(getBackupHistoryInfoList());
    Table historyTable = historyTableViewer.getTable();
    for (int i = 0; i < historyTable.getColumnCount(); i++) {
        historyTable.getColumn(i).pack();
    }
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) TableViewerSorter(com.cubrid.common.ui.spi.TableViewerSorter) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 73 with Table

use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.

the class ParamDumpResultDialog method createDialogArea.

/**
	 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 * @param parent The parent composite to contain the dialog area
	 * @return the dialog area control
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(parentComp, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.numColumns = 5;
    composite.setLayout(layout);
    //dynamicHelp end		
    createdbNameGroup(composite);
    table = new Table(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
    table.setHeaderVisible(true);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.horizontalSpan = 7;
    gridData.verticalSpan = 10;
    gridData.heightHint = 300;
    table.setLayoutData(gridData);
    table.setLinesVisible(true);
    CommonUITool.hackForYosemite(table);
    /*
		 * // fill in context menu
		 */
    Menu menu = new Menu(parent.getShell(), SWT.POP_UP);
    table.setMenu(menu);
    MenuItem copy = new MenuItem(menu, SWT.PUSH);
    copy.setText(Messages.bind(com.cubrid.cubridmanager.ui.logs.Messages.contextCopy, "Ctrl+C"));
    copy.setAccelerator(SWT.CTRL + 'C');
    copy.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            TextTransfer textTransfer = TextTransfer.getInstance();
            Clipboard clipboard = CommonUITool.getClipboard();
            StringBuilder content = new StringBuilder();
            TableItem[] items = table.getSelection();
            for (int i = 0; i < items.length; i++) {
                content.append(items[i].getText(0) + blank + items[i].getText(1) + blank + items[i].getText(2) + blank + System.getProperty("line.separator"));
            }
            String data = content.toString();
            if (data != null && !data.equals("")) {
                clipboard.setContents(new Object[] { data }, new Transfer[] { textTransfer });
            }
        }
    });
    table.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {

        public void keyPressed(org.eclipse.swt.events.KeyEvent event) {
            if ((event.stateMask & SWT.CTRL) != 0 && (event.stateMask & SWT.SHIFT) == 0 && event.keyCode == 'c') {
                TextTransfer textTransfer = TextTransfer.getInstance();
                Clipboard clipboard = CommonUITool.getClipboard();
                StringBuilder content = new StringBuilder();
                TableItem[] items = table.getSelection();
                for (int i = 0; i < items.length; i++) {
                    content.append(items[i].getText(0) + blank + items[i].getText(1) + blank + items[i].getText(2) + blank + System.getProperty("line.separator"));
                }
                String data = content.toString();
                if (data != null && !data.equals("")) {
                    clipboard.setContents(new Object[] { data }, new Transfer[] { textTransfer });
                }
            }
        }
    });
    setTitle(Messages.titleParamDumpDialog);
    setMessage(Messages.msgParamDumpDialog);
    initial();
    return parentComp;
}
Also used : Table(org.eclipse.swt.widgets.Table) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) MenuItem(org.eclipse.swt.widgets.MenuItem) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) TextTransfer(org.eclipse.swt.dnd.TextTransfer) Transfer(org.eclipse.swt.dnd.Transfer) Event(org.eclipse.swt.widgets.Event) Menu(org.eclipse.swt.widgets.Menu) Clipboard(org.eclipse.swt.dnd.Clipboard) TextTransfer(org.eclipse.swt.dnd.TextTransfer)

Example 74 with Table

use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.

the class NewDirectoryDialog method createDirectoryList.

/**
	 * create the directory list
	 * 
	 * @param composite the parent composite
	 */
private void createDirectoryList(Composite composite) {
    directoryList = new Table(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION);
    directoryList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    directoryList.setLinesVisible(true);
    directoryList.setHeaderVisible(true);
    directoryList.setEnabled(false);
    TableLayout tableLayout = new TableLayout();
    tableLayout.addColumnData(new ColumnWeightData(20, true));
    directoryList.setLayout(tableLayout);
    final TableColumn currentVolumeColumn = new TableColumn(directoryList, SWT.LEFT);
    currentVolumeColumn.setText(Messages.tblColDirectoryVolume);
    currentVolumeColumn.pack();
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) Table(org.eclipse.swt.widgets.Table) GridData(org.eclipse.swt.layout.GridData) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 75 with Table

use of org.eclipse.swt.widgets.Table in project cubrid-manager by CUBRID.

the class OptimizeDialog method createDialogArea.

/**
	 * Create dialog area content
	 *
	 * @param parent the parent composite
	 * @return the control
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    final Composite composite = new Composite(parentComp, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    composite.setLayout(layout);
    final Group dbNameGroup = new Group(composite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    dbNameGroup.setLayout(layout);
    final GridData gdDbNameGroup = new GridData(GridData.FILL_HORIZONTAL);
    dbNameGroup.setLayoutData(gdDbNameGroup);
    final Label dbNameLabel = new Label(dbNameGroup, SWT.LEFT | SWT.WRAP);
    dbNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    dbNameLabel.setText(Messages.lblOptimizeDbName);
    databaseName = new Text(dbNameGroup, SWT.BORDER);
    databaseName.setEnabled(false);
    final GridData gdDatabaseName = new GridData(SWT.FILL, SWT.FILL, true, false);
    databaseName.setLayoutData(gdDatabaseName);
    final Label optimizeLabel = new Label(dbNameGroup, SWT.WRAP);
    optimizeLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    optimizeLabel.setText(Messages.lblOptimizeClassName);
    GridData gdClassName = new org.eclipse.swt.layout.GridData(SWT.FILL, SWT.FILL, true, false);
    className = new Combo(dbNameGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
    className.setLayoutData(gdClassName);
    className.setVisibleItemCount(15);
    final Group descGroup = new Group(composite, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    descGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    descGroup.setLayout(layout);
    descGroup.setText(Messages.grpOptimizeDesc);
    final Label descriptionLabel = new Label(descGroup, SWT.WRAP);
    descriptionLabel.setText(Messages.lblOptimizeDesc);
    descriptionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    volumeTable = new Table(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.READ_ONLY);
    volumeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    volumeTable.setLinesVisible(false);
    volumeTable.setHeaderVisible(false);
    TableLayout tableLayout = new TableLayout();
    volumeTable.setLayout(tableLayout);
    final TableColumn currentVolumeColumn = new TableColumn(volumeTable, SWT.LEFT);
    currentVolumeColumn.setText("");
    currentVolumeColumn.pack();
    setMessage(Messages.msgOptimizeDbInformation);
    setTitle(Messages.titleOptimizeDbDialog);
    initial();
    return parentComp;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) TableLayout(org.eclipse.jface.viewers.TableLayout) TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

Table (org.eclipse.swt.widgets.Table)770 GridData (org.eclipse.swt.layout.GridData)368 Composite (org.eclipse.swt.widgets.Composite)325 TableColumn (org.eclipse.swt.widgets.TableColumn)324 TableViewer (org.eclipse.jface.viewers.TableViewer)303 GridLayout (org.eclipse.swt.layout.GridLayout)255 TableItem (org.eclipse.swt.widgets.TableItem)210 SelectionEvent (org.eclipse.swt.events.SelectionEvent)204 Label (org.eclipse.swt.widgets.Label)179 Button (org.eclipse.swt.widgets.Button)161 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)145 Point (org.eclipse.swt.graphics.Point)138 Text (org.eclipse.swt.widgets.Text)102 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)96 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)95 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)89 FillLayout (org.eclipse.swt.layout.FillLayout)87 Shell (org.eclipse.swt.widgets.Shell)82 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)81 Event (org.eclipse.swt.widgets.Event)80