Search in sources :

Example 61 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class DatabaseStatusEditor method createPartControl.

/**
	 * Create page content
	 *
	 * @param parent the parent composite
	 */
public void createPartControl(Composite parent) {
    scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    FillLayout flayout = new FillLayout();
    scrolledComp.setLayout(flayout);
    parentComp = new Composite(scrolledComp, SWT.NONE);
    parentComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    parentComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    parentComp.setLayout(layout);
    //database description information composite
    Composite descComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    descComp.setLayout(layout);
    GridData gdDescComp = new GridData(GridData.FILL_HORIZONTAL);
    descComp.setLayoutData(gdDescComp);
    descComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    Label descriptionLabel = new Label(descComp, SWT.LEFT | SWT.WRAP);
    descriptionLabel.setBackground(ResourceManager.getColor(255, 255, 255));
    Font font = ResourceManager.getFont("", 20, SWT.BOLD);
    descriptionLabel.setFont(font);
    GridData descGrid = new GridData(SWT.FILL, SWT.FILL, false, false);
    descriptionLabel.setLayoutData(descGrid);
    descriptionLabel.setText(database.getName());
    final String[] columnNameArr = new String[] { "col1", "col2" };
    dbInfoTableViewer = createCommonTableViewer(descComp, null, columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
    dbInfoTableViewer.setInput(dbInfoListData);
    dbInfoTable = dbInfoTableViewer.getTable();
    dbInfoTable.setLinesVisible(true);
    dbInfoTable.setHeaderVisible(false);
    if (!DbSpaceInfoList.useOld(database.getDatabaseInfo().getServerInfo().getEnvInfo())) {
        dbSpaceDescriptionTableViewer = createCommonTableViewer(descComp, null, new String[] { "type", "purpose", "volume_count", "used_size", "free_size", "total_size" }, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
        dbSpaceDescriptionTableViewer.setInput(dbSpaceDescriptionData);
        dbSpaceDescriptionTable = dbSpaceDescriptionTableViewer.getTable();
        dbSpaceDescriptionTable.setLinesVisible(true);
        dbSpaceDescriptionTable.setHeaderVisible(true);
        volumeDescriptionTableViewer = createCommonTableViewer(descComp, null, new String[] { "volid", "type", "purpose", "used_size", "free_size", "total_size", "volume_name" }, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
        volumeDescriptionTableViewer.setInput(volumeDescriptionData);
        volumeDescriptionTable = volumeDescriptionTableViewer.getTable();
        volumeDescriptionTable.setLinesVisible(true);
        volumeDescriptionTable.setHeaderVisible(true);
        fileSpaceDescriptionTableViewer = createCommonTableViewer(descComp, null, new String[] { "data_type", "file_count", "used_size", "file_table_size", "reserved_size", "total_size" }, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
        fileSpaceDescriptionTableViewer.setInput(fileSpaceDescriptionData);
        fileSpaceDescriptionTable = fileSpaceDescriptionTableViewer.getTable();
        fileSpaceDescriptionTable.setLinesVisible(true);
        fileSpaceDescriptionTable.setHeaderVisible(true);
    }
    //chart compostie
    chartComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = true;
    GridData gdChartComp = new GridData(GridData.FILL_HORIZONTAL);
    chartComp.setLayoutData(gdChartComp);
    chartComp.setLayout(layout);
    chartComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    scrolledComp.setContent(parentComp);
    scrolledComp.setMinHeight(800);
    scrolledComp.setMinWidth(800);
    loadData();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout) Font(org.eclipse.swt.graphics.Font)

Example 62 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class VolumeFolderInfoEditor method createPartControl.

/**
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 * @param parent the parent control
	 * @see IWorkbenchPart
	 */
public void createPartControl(Composite parent) {
    scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    FillLayout flayout = new FillLayout();
    scrolledComp.setLayout(flayout);
    parentComp = new Composite(scrolledComp, SWT.NONE);
    parentComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    parentComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    parentComp.setLayout(layout);
    parentComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    //the description composite
    Composite descComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    GridData gdDescComp = new GridData(GridData.FILL_HORIZONTAL);
    descComp.setLayoutData(gdDescComp);
    descComp.setLayout(layout);
    descComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    spaceNameLabel = new Label(descComp, SWT.LEFT | SWT.WRAP);
    spaceNameLabel.setBackground(ResourceManager.getColor(255, 255, 255));
    spaceNameLabel.setFont(ResourceManager.getFont("", 15, SWT.NONE));
    spaceNameLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
    Font font = ResourceManager.getFont("", 14, SWT.BOLD);
    spaceNameLabel.setFont(font);
    spaceNameLabel.setText("");
    final String[] columnNameArr = new String[] { "col1", "col2" };
    spInfoTableViewer = DatabaseStatusEditor.createCommonTableViewer(descComp, null, columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
    spInfoTableViewer.setInput(spInfoListData);
    spInfoTable = spInfoTableViewer.getTable();
    spInfoTable.setLinesVisible(true);
    spInfoTable.setHeaderVisible(false);
    //the chart composite
    chartComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    layout.numColumns = 2;
    GridData gdChartComp = new GridData(GridData.FILL_BOTH);
    chartComp.setLayoutData(gdChartComp);
    chartComp.setLayout(layout);
    chartComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    loadData();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout) Font(org.eclipse.swt.graphics.Font)

Example 63 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class VolumeInformationEditor method createPartControl.

/**
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 * @param parent the parent control
	 * @see IWorkbenchPart
	 */
public void createPartControl(Composite parent) {
    scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    FillLayout flayout = new FillLayout();
    scrolledComp.setLayout(flayout);
    parentComp = new Composite(scrolledComp, SWT.NONE);
    parentComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    parentComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    parentComp.setLayout(layout);
    Composite descComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    GridData gdDescComp = new GridData(GridData.FILL_HORIZONTAL);
    descComp.setLayoutData(gdDescComp);
    descComp.setLayout(layout);
    descComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    spaceNameLabel = new Label(descComp, SWT.LEFT | SWT.WRAP);
    spaceNameLabel.setBackground(ResourceManager.getColor(255, 255, 255));
    spaceNameLabel.setFont(ResourceManager.getFont("", 20, SWT.BOLD));
    spaceNameLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
    spaceNameLabel.setText("");
    final String[] columnNameArr = new String[] { "col1", "col2" };
    spInfoTableViewer = DatabaseStatusEditor.createCommonTableViewer(descComp, null, columnNameArr, CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
    spInfoTableViewer.setInput(spInfoListData);
    spInfoTable = spInfoTableViewer.getTable();
    spInfoTable.setLinesVisible(true);
    spInfoTable.setHeaderVisible(false);
    chartComp = new Composite(parentComp, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    GridData gdChartComp = new GridData();
    chartComp.setLayoutData(gdChartComp);
    chartComp.setLayout(layout);
    chartComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    loadData();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ChartComposite(org.jfree.experimental.chart.swt.ChartComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 64 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class DBSpaceLabelProvider method createServerInfoItem.

private void createServerInfoItem(ExpandBar bar, int index) {
    /* Database server information */
    ExpandItem dbServerInfoItem = new ExpandItem(bar, SWT.NONE, index);
    dbServerInfoItem.setText(Messages.titleServerInfo);
    Composite dbServerComposite = new Composite(bar, SWT.None);
    dbServerComposite.setLayout(new FillLayout());
    dbServerInfoText = new StyledText(dbServerComposite, SWT.MULTI);
    dbServerInfoText.setEditable(false);
    dbServerInfoItem.setControl(dbServerComposite);
    dbServerInfoItem.setHeight(110);
    dbServerInfoItem.setExpanded(true);
}
Also used : StyledText(org.eclipse.swt.custom.StyledText) Composite(org.eclipse.swt.widgets.Composite) ExpandItem(org.eclipse.swt.widgets.ExpandItem) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 65 with FillLayout

use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.

the class DBSpaceLabelProvider method createBrokerInfoItem.

private void createBrokerInfoItem(ExpandBar bar, int index) {
    ExpandItem brokerInfoItem = new ExpandItem(bar, SWT.NONE, index);
    brokerInfoItem.setText(Messages.titleBrokerInfo);
    Composite brokerComposite = new Composite(bar, SWT.None);
    brokerComposite.setLayout(new FillLayout());
    brokerTableViewer = new TableViewer(brokerComposite, SWT.BORDER | SWT.FULL_SELECTION);
    brokerTableViewer.getTable().setHeaderVisible(true);
    brokerTableViewer.getTable().setLinesVisible(true);
    brokerTableViewer.setContentProvider(new BrokersStatusContentProvider());
    BrokersStatusLabelProvider brokersStatusLabelProvider = new BrokersStatusLabelProvider();
    brokersStatusLabelProvider.setServerInfo(serverInfo);
    brokerTableViewer.setLabelProvider(brokersStatusLabelProvider);
    TableColumn tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblBrokerName);
    tblColumn.setToolTipText(Messages.tipBrokerName);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.CENTER);
    tblColumn.setText(Messages.tblBrokerStatus);
    tblColumn.setToolTipText(Messages.tipBrokerStatus);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblBrokerProcess);
    tblColumn.setToolTipText(Messages.tipBrokerProcess);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblPort);
    tblColumn.setToolTipText(Messages.tipPort);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblServer);
    tblColumn.setToolTipText(Messages.tipServer);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblQueue);
    tblColumn.setToolTipText(Messages.tipQueue);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblRequest);
    tblColumn.setToolTipText(Messages.tipRequest);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblTps);
    tblColumn.setToolTipText(Messages.tipTps);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblQps);
    tblColumn.setToolTipText(Messages.tipQps);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblLongTran);
    tblColumn.setToolTipText(Messages.tipLongTran);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblLongQuery);
    tblColumn.setToolTipText(Messages.tipLongQuery);
    tblColumn = new TableColumn(brokerTableViewer.getTable(), SWT.LEFT);
    tblColumn.setText(Messages.tblErrQuery);
    tblColumn.setToolTipText(Messages.tipErrQuery);
    brokerInfoItem.setHeight(120);
    brokerInfoItem.setExpanded(true);
    brokerInfoItem.setControl(brokerComposite);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ExpandItem(org.eclipse.swt.widgets.ExpandItem) BrokersStatusContentProvider(com.cubrid.cubridmanager.ui.broker.editor.BrokersStatusContentProvider) FillLayout(org.eclipse.swt.layout.FillLayout) TableViewer(org.eclipse.jface.viewers.TableViewer) BrokersStatusLabelProvider(com.cubrid.cubridmanager.ui.broker.editor.BrokersStatusLabelProvider) TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)298 Composite (org.eclipse.swt.widgets.Composite)180 GridData (org.eclipse.swt.layout.GridData)130 Shell (org.eclipse.swt.widgets.Shell)104 GridLayout (org.eclipse.swt.layout.GridLayout)97 Label (org.eclipse.swt.widgets.Label)69 SelectionEvent (org.eclipse.swt.events.SelectionEvent)67 Display (org.eclipse.swt.widgets.Display)63 Button (org.eclipse.swt.widgets.Button)60 Point (org.eclipse.swt.graphics.Point)55 Table (org.eclipse.swt.widgets.Table)48 Group (org.eclipse.swt.widgets.Group)40 SelectionListener (org.eclipse.swt.events.SelectionListener)38 TableColumn (org.eclipse.swt.widgets.TableColumn)38 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)37 Text (org.eclipse.swt.widgets.Text)36 Test (org.junit.Test)36 TableItem (org.eclipse.swt.widgets.TableItem)35 SashForm (org.eclipse.swt.custom.SashForm)31 Rectangle (org.eclipse.swt.graphics.Rectangle)29