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();
}
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();
}
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();
}
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();
}
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);
}
Aggregations