Search in sources :

Example 26 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project cubrid-manager by CUBRID.

the class ERSchemaEditor method createToolBar.

public void createToolBar(Composite parent) {
    ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    FillLayout flayout = new FillLayout();
    scrolledComp.setLayout(flayout);
    topPane = new Composite(scrolledComp, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    gridLayout.horizontalSpacing = 0;
    topPane.setLayout(gridLayout);
    topPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrolledComp.setContent(topPane);
    scrolledComp.setExpandHorizontal(true);
    scrolledComp.setExpandVertical(true);
    final Composite toolBarComposite = new Composite(topPane, SWT.NONE);
    toolBarComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    GridLayout gridLayout2 = new GridLayout();
    gridLayout2.marginHeight = 0;
    gridLayout2.horizontalSpacing = 0;
    gridLayout2.marginWidth = 0;
    toolBarComposite.setLayout(gridLayout2);
    erToolBar = new ERSchemaToolBar(toolBarComposite, SWT.WRAP | SWT.FLAT, this);
    erToolBar.init();
    topPane.pack();
    erToolBar.pack();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) CombinedQueryEditorComposite(com.cubrid.common.ui.query.control.CombinedQueryEditorComposite) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 27 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite 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 28 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite 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 29 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite 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 30 with ScrolledComposite

use of org.eclipse.swt.custom.ScrolledComposite in project cubrid-manager by CUBRID.

the class BrokerDashboardViewPart method createPartControl.

/**
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 * 
	 * @param parent the parent composite
	 */
public void createPartControl(Composite parent) {
    final ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    composite = new Composite(scrolledComp, SWT.NONE);
    composite.setLayout(new GridLayout());
    BrokerTblColumnSetHelp bcsh = BrokerTblColumnSetHelp.getInstance();
    bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusBasicColumn, BrokerStatusBasicColumn.values());
    bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusAsColumn, BrokerStatusAsColumn.values());
    bcsh.loadSetting(BrokerTblColumnSetHelp.StatusColumn.BrokerStatusJqColumn, BrokerStatusJqColumn.values());
    brokerTablePart.setServerInfo(serverInfo);
    brokerTablePart.setAppendDiag(true);
    basicTableViewer = brokerTablePart.createBasicTable(composite);
    asTableViewer = brokerTablePart.createAsTable(composite);
    jqTableViewer = brokerTablePart.createJobTable(composite);
    makeActions();
    composite.addControlListener(new ControlAdapter() {

        public void controlResized(ControlEvent event) {
            updateTableLayout();
        }
    });
    MenuManager menuManager = new MenuManager();
    menuManager.setRemoveAllWhenShown(true);
    menuManager.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            IStructuredSelection selection = (IStructuredSelection) asTableViewer.getSelection();
            ApplyServerInfo as = (ApplyServerInfo) (selection.toArray()[0]);
            RestartAction restartAcion = new RestartAction(as.getAs_id());
            manager.add(restartAcion);
        }
    });
    Menu contextMenu = menuManager.createContextMenu(asTableViewer.getControl());
    asTableViewer.getControl().setMenu(contextMenu);
    scrolledComp.setContent(composite);
    scrolledComp.setExpandHorizontal(true);
    scrolledComp.setExpandVertical(true);
    scrolledComp.setMinHeight(300);
    scrolledComp.setMinWidth(800);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlAdapter(org.eclipse.swt.events.ControlAdapter) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ApplyServerInfo(com.cubrid.cubridmanager.core.broker.model.ApplyServerInfo) IMenuListener(org.eclipse.jface.action.IMenuListener) GridLayout(org.eclipse.swt.layout.GridLayout) BrokerTblColumnSetHelp(com.cubrid.cubridmanager.ui.broker.editor.internal.BrokerTblColumnSetHelp) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) ControlEvent(org.eclipse.swt.events.ControlEvent)

Aggregations

ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)61 GridData (org.eclipse.swt.layout.GridData)45 Composite (org.eclipse.swt.widgets.Composite)44 GridLayout (org.eclipse.swt.layout.GridLayout)40 Label (org.eclipse.swt.widgets.Label)27 FillLayout (org.eclipse.swt.layout.FillLayout)16 SelectionEvent (org.eclipse.swt.events.SelectionEvent)15 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)13 Point (org.eclipse.swt.graphics.Point)12 Button (org.eclipse.swt.widgets.Button)12 Text (org.eclipse.swt.widgets.Text)12 Control (org.eclipse.swt.widgets.Control)10 ControlEvent (org.eclipse.swt.events.ControlEvent)9 Group (org.eclipse.swt.widgets.Group)9 HistoryComposite (com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite)8 Rectangle (org.eclipse.swt.graphics.Rectangle)7 ArrayList (java.util.ArrayList)5 ControlListener (org.eclipse.swt.events.ControlListener)5 FormAttachment (org.eclipse.swt.layout.FormAttachment)5 FormData (org.eclipse.swt.layout.FormData)5