use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class DBAuthComparator method createPartControl.
public void createPartControl(Composite parent) {
parent.setLayout(new GridLayout(1, false));
ToolBar toolBar = new ToolBar(parent, SWT.LEFT_TO_RIGHT | SWT.FLAT);
toolBar.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
ToolItem refreshItem = new ToolItem(toolBar, SWT.PUSH);
refreshItem.setText(Messages.btnRefresh);
refreshItem.setToolTipText(Messages.btnRefresh);
refreshItem.setImage(CommonUIPlugin.getImage("icons/action/refresh.png"));
refreshItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
refresh();
}
});
new ToolItem(toolBar, SWT.SEPARATOR);
ToolItem addUserItem = new ToolItem(toolBar, SWT.NONE);
addUserItem.setText(Messages.btnAddUser);
addUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_add.png"));
addUserItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
addUser();
}
});
ToolItem editUserItem = new ToolItem(toolBar, SWT.NONE);
editUserItem.setText(Messages.btnEditUser);
editUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_edit.png"));
editUserItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
editUser();
}
});
ToolItem dropUserItem = new ToolItem(toolBar, SWT.NONE);
dropUserItem.setText(Messages.btnDropUser);
dropUserItem.setImage(CommonUIPlugin.getImage("icons/action/user_delete.png"));
dropUserItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
dropUser();
}
});
SashForm form = new SashForm(parent, SWT.HORIZONTAL);
form.setLayout(new FillLayout());
form.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, -1));
createUsersTable(form);
createAuthTable(form);
form.setWeights(new int[] { 150, 850 });
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class EditVirtualTableDialog method createTableInformationGroup.
private void createTableInformationGroup(Composite compositeGenaral) {
final Group group = new Group(compositeGenaral, SWT.NONE);
group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
group.setLayout(gridLayout);
group.setText(Messages.lblTableInfo);
final Label tableNameLabel = new Label(group, SWT.NONE);
tableNameLabel.setData(Messages.dataNewKey, null);
tableNameLabel.setText(Messages.lblTableName);
final SchemaInfo newSchemaInfo = getNewSchemaInfo();
tableNameComp = new Composite(group, SWT.NONE);
{
GridLayout gl = new GridLayout();
gl.numColumns = 2;
gl.marginWidth = 0;
tableNameComp.setLayout(gl);
tableNameComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
tableNameText = new Text(tableNameComp, SWT.BORDER);
{
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
tableNameText.setLayoutData(gd);
}
tableNameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
if (tableNameText.getText().length() == 0) {
CommonUITool.hideErrorBaloon(errorBaloon);
} else if (verifyTableName()) {
String tableName = tableNameText.getText();
newSchemaInfo.setClassname(tableName);
}
}
});
tableNameText.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
CommonUITool.hideErrorBaloon(errorBaloon);
}
});
}
//char set
if (supportCharset) {
Composite collationComposite = new Composite(tableNameComp, SWT.NONE);
collationComposite.setLayout(new GridLayout(2, false));
final Label collationLabel = new Label(collationComposite, SWT.NONE);
collationLabel.setText(Messages.lblCollation);
collationCombo = new Combo(collationComposite, SWT.READ_ONLY);
collationCombo.setLayout(new FillLayout());
collationCombo.setVisibleItemCount(10);
fillCollationCombo();
String collation = collationCombo.getText();
newSchemaInfo.setCollation(collation);
collationCombo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
String collation = collationCombo.getText();
newSchemaInfo.setCollation(collation);
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
if (!isNewTableFlag && newSchemaInfo.getCollation() != null) {
collationCombo.setText(newSchemaInfo.getCollation());
}
} else {
new Label(tableNameComp, SWT.NONE);
}
if (erSchema.isPhysicModel()) {
//desc info
final Label tableDescLabel = new Label(group, SWT.NONE);
tableDescLabel.setText(Messages.lblTableDesc);
tableDescText = new Text(group, SWT.BORDER);
tableDescText.setTextLimit(612);
tableDescText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
// tableDescText.setLayoutData(new FillLayout());
if (newSchemaInfo != null && newSchemaInfo.getDescription() != null) {
tableDescText.setText(newSchemaInfo.getDescription());
}
tableDescText.addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
CommonUITool.hideErrorBaloon(errorBaloon);
}
});
tableDescText.setEditable(true);
}
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class ViewDashboardEditorPart method createTabFolder.
public void createTabFolder(Composite parent) {
tabFolder = new CTabFolder(parent, SWT.TOP);
tabFolder.setLayout(new FillLayout());
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
tabFolder.setSimple(false);
tabFolder.setUnselectedImageVisible(true);
tabFolder.setUnselectedCloseVisible(true);
tabFolder.setBorderVisible(true);
tabFolder.setSelectionBackground(ResourceManager.getColor(136, 161, 227));
tabFolder.setSelectionForeground(ResourceManager.getColor(SWT.COLOR_BLACK));
Menu menu = new Menu(tabFolder.getShell(), SWT.POP_UP);
tabFolder.setMenu(menu);
MenuItem closeItem = new MenuItem(menu, SWT.PUSH);
closeItem.setText(Messages.tablesDetailInfoPartCloseMenu);
closeItem.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
CTabItem item = tabFolder.getSelection();
item.dispose();
}
});
MenuItem closeOthersItem = new MenuItem(menu, SWT.PUSH);
closeOthersItem.setText(Messages.tablesDetailInfoPartCloseOthersMenu);
closeOthersItem.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
CTabItem[] items = tabFolder.getItems();
CTabItem selectedItem = tabFolder.getSelection();
for (CTabItem item : items) {
if (!item.equals(selectedItem)) {
item.dispose();
}
}
}
});
MenuItem closeAllItem = new MenuItem(menu, SWT.PUSH);
closeAllItem.setText(Messages.tablesDetailInfoPartCloseAllMenu);
closeAllItem.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
CTabItem[] items = tabFolder.getItems();
for (CTabItem item : items) {
item.dispose();
}
}
});
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class ObjectInfoComposite method initDataTabItem.
/**
* Initial demo data table setting
*
*/
private void initDataTabItem() {
CTabItem dataTabItem = new CTabItem(objInfoFolder, SWT.NONE);
dataTabItem.setText(Messages.titleData);
dataTabItem.setShowClose(false);
Composite composite = new Composite(objInfoFolder, SWT.None);
dataTabItem.setControl(composite);
objInfoFolder.setSelection(dataTabItem);
composite.setLayout(new FillLayout());
demoDataTable = new Table(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
demoDataTable.setHeaderVisible(true);
demoDataTable.setLinesVisible(true);
CommonUITool.hackForYosemite(demoDataTable);
}
use of org.eclipse.swt.layout.FillLayout in project cubrid-manager by CUBRID.
the class ObjectInfoComposite method initColumnTabItem.
/**
* Initial column tab item
*
*/
private void initColumnTabItem() {
CTabItem columnTabItem = new CTabItem(objInfoFolder, SWT.NONE);
columnTabItem.setText(Messages.titleColumn);
columnTabItem.setShowClose(false);
Composite composite = new Composite(objInfoFolder, SWT.None);
columnTabItem.setControl(composite);
composite.setLayout(new FillLayout());
if (isTable) {
initTableColumn(composite);
} else {
initViewColumn(composite);
}
}
Aggregations