use of org.eclipse.swt.layout.FormLayout in project cubrid-manager by CUBRID.
the class SettingHostPage method createControl.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FormLayout());
setControl(container);
setDescription(Messages.descSettingHostPage);
setPageComplete(false);
Composite leftComposite = new Composite(container, SWT.NONE);
leftComposite.setLayout(new GridLayout(2, false));
FormData leftData = new FormData();
leftData.top = new FormAttachment(0, 5);
leftData.bottom = new FormAttachment(100, 0);
leftData.left = new FormAttachment(0, 5);
leftData.right = new FormAttachment(50, -5);
leftComposite.setLayoutData(leftData);
Label separator = new Label(container, SWT.SEPARATOR);
FormData separatorData = new FormData();
separatorData.top = new FormAttachment(0, 5);
separatorData.bottom = new FormAttachment(100, -5);
separatorData.left = new FormAttachment(50, -5);
separatorData.right = new FormAttachment(50, 5);
separator.setLayoutData(separatorData);
Composite rightComposite = new Composite(container, SWT.NONE);
rightComposite.setLayout(new GridLayout(3, false));
FormData rightData = new FormData();
rightData.top = new FormAttachment(0, 5);
rightData.bottom = new FormAttachment(100, 0);
rightData.left = new FormAttachment(50, 5);
rightData.right = new FormAttachment(100, -5);
rightComposite.setLayoutData(rightData);
/*Create left widget*/
Label hostALabel = new Label(leftComposite, SWT.None);
hostALabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostALabel.setText(Messages.lblMaster);
masterHostText = new Text(leftComposite, SWT.BORDER);
masterHostText.setEnabled(false);
masterHostText.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
Label masterNameLabel = new Label(leftComposite, SWT.None);
masterNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
masterNameLabel.setText(Messages.lblMasterHost);
masterHostName = new Text(leftComposite, SWT.BORDER);
masterHostName.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
masterHostName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
validate();
}
});
masterDBList = new org.eclipse.swt.widgets.List(leftComposite, SWT.BORDER);
masterDBList.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 2, 1, -1, -1));
masterDBList.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
validate();
}
});
/*Create right widget*/
Label hostBLabel = new Label(rightComposite, SWT.None);
hostBLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostBLabel.setText(Messages.lblSlave);
slaveHostCombo = new Combo(rightComposite, SWT.READ_ONLY);
slaveHostCombo.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
slaveHostCombo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
selectedSlaveServer = null;
String serverName = slaveHostCombo.getText();
List<CubridServer> serverList = CMHostNodePersistManager.getInstance().getAllServers();
for (CubridServer server : serverList) {
if (serverName.equals(server.getName())) {
selectedSlaveServer = server;
break;
}
}
initSlaveDBList(selectedSlaveServer);
validate();
}
});
Label slaveNameLabel = new Label(rightComposite, SWT.None);
slaveNameLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
slaveNameLabel.setText(Messages.lblSlaveHost);
slaveHostName = new Text(rightComposite, SWT.BORDER);
slaveHostName.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
slaveHostName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
validate();
}
});
slaveDBList = new org.eclipse.swt.widgets.List(rightComposite, SWT.BORDER);
slaveDBList.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
slaveDBList.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
validate();
}
});
init();
}
use of org.eclipse.swt.layout.FormLayout in project MonjaDB by Kanatoko.
the class MConnectDialog method createDialogArea.
//--------------------------------------------------------------------------------
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new FormLayout());
Group connGroup = new Group(composite, SWT.SHADOW_ETCHED_OUT);
connGroup.setText("Connection Type");
FormData d7 = new FormData();
d7.top = new FormAttachment(0, 10);
d7.left = new FormAttachment(0, 10);
d7.right = new FormAttachment(0, 285);
d7.bottom = new FormAttachment(0, 100);
connGroup.setLayoutData(d7);
connGroup.setLayout(new FormLayout());
connectionRadio1 = new Button(connGroup, SWT.RADIO);
connectionRadio1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
}
});
FormData fd_connectionRadio1 = new FormData();
fd_connectionRadio1.top = new FormAttachment(0, 8);
fd_connectionRadio1.right = new FormAttachment(100, -59);
fd_connectionRadio1.left = new FormAttachment(0, 12);
connectionRadio1.setLayoutData(fd_connectionRadio1);
connectionRadio1.setText("Normal");
connectionRadio2 = new Button(connGroup, SWT.RADIO);
FormData fd_connectionRadio2 = new FormData();
fd_connectionRadio2.top = new FormAttachment(connectionRadio1, 5);
fd_connectionRadio2.right = new FormAttachment(100, -59);
fd_connectionRadio2.left = new FormAttachment(0, 12);
connectionRadio2.setLayoutData(fd_connectionRadio2);
connectionRadio2.setText("Via SSH");
Group grpSshConfiguration = new Group(composite, SWT.NONE);
grpSshConfiguration.setText("SSH Configuration");
grpSshConfiguration.setLayout(new FormLayout());
FormData fd_grpSshConfiguration = new FormData();
fd_grpSshConfiguration.top = new FormAttachment(0, 10);
fd_grpSshConfiguration.bottom = new FormAttachment(0, 250);
fd_grpSshConfiguration.left = new FormAttachment(0, 300);
fd_grpSshConfiguration.right = new FormAttachment(100, -10);
grpSshConfiguration.setLayoutData(fd_grpSshConfiguration);
Group mongoGroup = new Group(composite, SWT.NONE);
mongoGroup.setText("MongoDB");
mongoGroup.setLayout(new FormLayout());
FormData fd_grpMongodb = new FormData();
fd_grpMongodb.top = new FormAttachment(connGroup, 16);
fd_grpMongodb.bottom = new FormAttachment(0, 250);
fd_grpMongodb.right = new FormAttachment(grpSshConfiguration, -17);
Label SSHLabel1 = new Label(grpSshConfiguration, SWT.NONE);
FormData fd_SSHLabel1 = new FormData();
fd_SSHLabel1.right = new FormAttachment(0, 236);
fd_SSHLabel1.top = new FormAttachment(0, 10);
fd_SSHLabel1.left = new FormAttachment(0, 18);
SSHLabel1.setLayoutData(fd_SSHLabel1);
SSHLabel1.setText("SSH \"user@host(:port)\"");
sshText = new Text(grpSshConfiguration, SWT.BORDER);
FormData fd_sshText = new FormData();
fd_sshText.right = new FormAttachment(100, -20);
fd_sshText.top = new FormAttachment(0, 30);
fd_sshText.left = new FormAttachment(0, 18);
sshText.setLayoutData(fd_sshText);
Label lblNewLabel = new Label(grpSshConfiguration, SWT.NONE);
FormData fd_lblNewLabel = new FormData();
fd_lblNewLabel.right = new FormAttachment(0, 218);
fd_lblNewLabel.top = new FormAttachment(0, 62);
fd_lblNewLabel.left = new FormAttachment(0, 18);
lblNewLabel.setLayoutData(fd_lblNewLabel);
lblNewLabel.setText("SSH Private Key File");
keyText = new Text(grpSshConfiguration, SWT.BORDER);
FormData fd_keyText = new FormData();
fd_keyText.right = new FormAttachment(sshText, -40, SWT.RIGHT);
fd_keyText.top = new FormAttachment(lblNewLabel, 6);
fd_keyText.left = new FormAttachment(SSHLabel1, 0, SWT.LEFT);
keyText.setLayoutData(fd_keyText);
Button btnBrowse = new Button(grpSshConfiguration, SWT.NONE);
btnBrowse.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String keyFileName = loadDialog.open();
if (keyFileName != null) {
keyText.setText(keyFileName);
}
}
});
btnBrowse.setToolTipText("Browse");
FormData fd_btnBrowse = new FormData();
fd_btnBrowse.left = new FormAttachment(keyText, 5);
fd_btnBrowse.bottom = new FormAttachment(lblNewLabel, 30, SWT.BOTTOM);
fd_btnBrowse.top = new FormAttachment(lblNewLabel, 3);
fd_btnBrowse.right = new FormAttachment(100, -6);
btnBrowse.setLayoutData(fd_btnBrowse);
btnBrowse.setText("...");
fd_grpMongodb.left = new FormAttachment(0, 10);
mongoGroup.setLayoutData(fd_grpMongodb);
FormData d2 = new FormData();
d2.top = new FormAttachment(0, 15);
d2.left = new FormAttachment(0, 8);
Label hostLabel = new Label(mongoGroup, SWT.NONE);
FormData fd_hostLabel = new FormData();
fd_hostLabel.top = new FormAttachment(0, 15);
fd_hostLabel.left = new FormAttachment(0, 10);
hostLabel.setLayoutData(fd_hostLabel);
hostLabel.setText("Host :");
hostText = new Text(mongoGroup, SWT.BORDER);
FormData fd_portText = new FormData();
fd_portText.right = new FormAttachment(100, -20);
fd_portText.left = new FormAttachment(hostLabel, 9);
fd_portText.top = new FormAttachment(hostLabel, -2, SWT.TOP);
hostText.setLayoutData(fd_portText);
Label lblPort = new Label(mongoGroup, SWT.NONE);
FormData fd_lblPort1 = new FormData();
fd_lblPort1.top = new FormAttachment(hostLabel, 17);
fd_lblPort1.left = new FormAttachment(0, 10);
lblPort.setLayoutData(fd_lblPort1);
lblPort.setText("Port :");
portText = new Text(mongoGroup, SWT.BORDER);
FormData fd_portText2 = new FormData();
fd_portText2.top = new FormAttachment(0, 44);
fd_portText2.right = new FormAttachment(100, -82);
fd_portText2.left = new FormAttachment(lblPort, 12);
portText.setLayoutData(fd_portText2);
Label lblDatabase = new Label(mongoGroup, SWT.NONE);
FormData fd_lblDatabase = new FormData();
fd_lblDatabase.top = new FormAttachment(portText, 12);
fd_lblDatabase.left = new FormAttachment(hostLabel, 0, SWT.LEFT);
lblDatabase.setLayoutData(fd_lblDatabase);
lblDatabase.setText("Database :");
dbText = new Text(mongoGroup, SWT.BORDER);
FormData fd_databaseText = new FormData();
fd_databaseText.right = new FormAttachment(100, -50);
fd_databaseText.top = new FormAttachment(portText, 9);
fd_databaseText.left = new FormAttachment(lblDatabase, 13);
dbText.setLayoutData(fd_databaseText);
hostText.setText(prop.getProperty(CONNECT_DIALOG_HOST, "127.0.0.1"));
dbText.setText(prop.getProperty(CONNECT_DIALOG_DB, "test"));
portText.setText(prop.getProperty(CONNECT_DIALOG_PORT, "27017"));
sshText.setText(prop.getProperty(CONNECT_DIALOG_SSH, ""));
keyText.setText(prop.getProperty(CONNECT_DIALOG_SSH_KEY, getDefaultKeyLocation()));
if (prop.getBooleanProperty(CONNECT_DIALOG_NORMAL_CONNECTION, true)) {
connectionRadio1.setSelection(true);
} else {
connectionRadio2.setSelection(true);
}
loadDialog = new FileDialog(parent.getShell(), SWT.OPEN);
loadDialog.setFilterPath(prop.getProperty("loadDialogPath"));
return composite;
}
use of org.eclipse.swt.layout.FormLayout in project MonjaDB by Kanatoko.
the class MPasswordDialog method createDialogArea.
//--------------------------------------------------------------------------------
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new FormLayout());
Group group1 = new Group(composite, SWT.SHADOW_ETCHED_OUT);
FormData d7 = new FormData();
d7.top = new FormAttachment(0, 6);
d7.left = new FormAttachment(0, 3);
d7.right = new FormAttachment(100, -3);
d7.bottom = new FormAttachment(100, -3);
group1.setLayoutData(d7);
group1.setLayout(new FormLayout());
Label passwdLabel = new Label(group1, SWT.NONE);
passwdLabel.setText("Password :");
FormData fd_passwdLabel = new FormData();
fd_passwdLabel.top = new FormAttachment(0, 15);
fd_passwdLabel.left = new FormAttachment(0, 8);
passwdLabel.setLayoutData(fd_passwdLabel);
passwordTExt = new Text(group1, SWT.BORDER | SWT.PASSWORD);
FormData d1 = new FormData();
d1.top = new FormAttachment(passwdLabel, -2, SWT.TOP);
d1.left = new FormAttachment(passwdLabel, 10, SWT.RIGHT);
d1.right = new FormAttachment(passwdLabel, 200, SWT.RIGHT);
//d1.bottom = new FormAttachment( 100, -5 );
passwordTExt.setLayoutData(d1);
Composite composite_1 = new Composite(group1, SWT.NONE);
composite_1.setLayout(new FormLayout());
FormData fd_composite_1 = new FormData();
fd_composite_1.right = new FormAttachment(passwordTExt, 20, SWT.RIGHT);
fd_composite_1.bottom = new FormAttachment(0, 50);
fd_composite_1.top = new FormAttachment(0, 3);
fd_composite_1.left = new FormAttachment(passwordTExt, 14);
composite_1.setLayoutData(fd_composite_1);
return composite;
}
use of org.eclipse.swt.layout.FormLayout in project MonjaDB by Kanatoko.
the class MPromptDialog method createDialogArea.
//--------------------------------------------------------------------------------
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new FormLayout());
Group group1 = new Group(composite, SWT.SHADOW_ETCHED_OUT);
FormData d7 = new FormData();
d7.top = new FormAttachment(0, 6);
d7.left = new FormAttachment(0, 3);
d7.right = new FormAttachment(100, -3);
d7.bottom = new FormAttachment(100, -3);
group1.setLayoutData(d7);
group1.setLayout(new FormLayout());
Label passwdLabel = new Label(group1, SWT.NONE);
passwdLabel.setText(labelText);
FormData fd_passwdLabel = new FormData();
fd_passwdLabel.top = new FormAttachment(0, 15);
fd_passwdLabel.left = new FormAttachment(0, 8);
passwdLabel.setLayoutData(fd_passwdLabel);
text = new Text(group1, SWT.BORDER);
FormData d1 = new FormData();
d1.top = new FormAttachment(passwdLabel, -2, SWT.TOP);
d1.left = new FormAttachment(passwdLabel, 10, SWT.RIGHT);
d1.right = new FormAttachment(passwdLabel, 200, SWT.RIGHT);
//d1.bottom = new FormAttachment( 100, -5 );
text.setLayoutData(d1);
text.setText(defaultValue);
Composite composite_1 = new Composite(group1, SWT.NONE);
composite_1.setLayout(new FormLayout());
FormData fd_composite_1 = new FormData();
fd_composite_1.right = new FormAttachment(text, 20, SWT.RIGHT);
fd_composite_1.bottom = new FormAttachment(0, 50);
fd_composite_1.top = new FormAttachment(0, 3);
fd_composite_1.left = new FormAttachment(text, 14);
composite_1.setLayoutData(fd_composite_1);
return composite;
}
use of org.eclipse.swt.layout.FormLayout in project cubrid-manager by CUBRID.
the class SettingCubridConfPage method createControl.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FormLayout());
setControl(container);
setDescription(Messages.descSettingCubridPage);
Composite leftComposite = new Composite(container, SWT.NONE);
leftComposite.setLayout(new GridLayout(3, false));
FormData leftData = new FormData();
leftData.top = new FormAttachment(0, 5);
leftData.bottom = new FormAttachment(100, 0);
leftData.left = new FormAttachment(0, 5);
leftData.right = new FormAttachment(50, -5);
leftComposite.setLayoutData(leftData);
Label separator = new Label(container, SWT.SEPARATOR);
FormData separatorData = new FormData();
separatorData.top = new FormAttachment(0, 5);
separatorData.bottom = new FormAttachment(100, -5);
separatorData.left = new FormAttachment(50, -5);
separatorData.right = new FormAttachment(50, 5);
separator.setLayoutData(separatorData);
Composite rightComposite = new Composite(container, SWT.NONE);
rightComposite.setLayout(new GridLayout(3, false));
FormData rightData = new FormData();
rightData.top = new FormAttachment(0, 5);
rightData.bottom = new FormAttachment(100, 0);
rightData.left = new FormAttachment(50, 5);
rightData.right = new FormAttachment(100, -5);
rightComposite.setLayoutData(rightData);
/*Create left widget*/
Label hostALabel = new Label(leftComposite, SWT.None);
hostALabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostALabel.setText(Messages.lblMaster);
masterHostLabel = new Label(leftComposite, SWT.None);
masterHostLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
masterViewer = new TableViewer(leftComposite, SWT.BORDER | SWT.FULL_SELECTION);
masterViewer.getTable().setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
masterViewer.getTable().setLinesVisible(true);
masterViewer.getTable().setHeaderVisible(true);
masterViewer.setContentProvider(new TableContentProvider());
masterViewer.setLabelProvider(new CubridConfTableProvider());
masterViewer.setColumnProperties(PROPS);
CellEditor[] editorsA = new CellEditor[2];
editorsA[0] = null;
editorsA[1] = new TextCellEditor(masterViewer.getTable());
masterViewer.setCellEditors(editorsA);
masterViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (property.equals(PROPS[1])) {
return true;
}
return false;
}
public Object getValue(Object element, String property) {
DataModel model = (DataModel) element;
if (property.equals(PROPS[0])) {
return model.getKey() == null ? "" : model.getKey();
} else if (property.equals(PROPS[1])) {
return model.getValue() == null ? "" : model.getValue();
}
return "";
}
public void modify(Object element, String property, Object value) {
TableItem item = (TableItem) element;
DataModel model = (DataModel) item.getData();
model.setValue(value.toString());
masterViewer.refresh(model);
updateHAModel(masterViewer, model, false);
}
});
TableColumn keyAColumn = new TableColumn(masterViewer.getTable(), SWT.LEFT);
keyAColumn.setText(Messages.lblKey);
keyAColumn.setWidth(160);
TableColumn valueAColumn = new TableColumn(masterViewer.getTable(), SWT.LEFT);
valueAColumn.setText(Messages.lblValue);
valueAColumn.setWidth(200);
Label masterDBLabel = new Label(leftComposite, SWT.None);
masterDBLabel.setText(Messages.lblDatabase);
masterDBLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
masterDBCombo = new Combo(leftComposite, SWT.BORDER | SWT.READ_ONLY);
masterDBCombo.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
masterDBCombo.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
HAModel haModel = getConfigHAWizard().getHaModel();
/*Init table data*/
initTableData(haModel.getMasterServer(), true);
HAServer haServer = haModel.getSlaveServer();
initTableData(haServer, false);
}
});
ToolBar toolBarA = new ToolBar(leftComposite, SWT.None);
toolBarA.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_END, 1, 1, -1, -1));
ToolItem addItemA = new ToolItem(toolBarA, SWT.None);
addItemA.setToolTipText(Messages.itemAddParameter);
addItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/add_param.gif"));
addItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
addParameter(masterViewer);
}
});
ToolItem editItemA = new ToolItem(toolBarA, SWT.None);
editItemA.setToolTipText(Messages.itemEditParameter);
editItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/edit_param.gif"));
editItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
editParameter(masterViewer);
}
});
ToolItem dropItemA = new ToolItem(toolBarA, SWT.None);
dropItemA.setToolTipText(Messages.itemDeleteParameter);
dropItemA.setImage(CubridManagerUIPlugin.getImage("/icons/replication/delete_param.gif"));
dropItemA.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
dropParameter(masterViewer);
}
});
/*Create right widget*/
Label hostBLabel = new Label(rightComposite, SWT.None);
hostBLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
hostBLabel.setText(Messages.lblSlave);
slaveHostLabel = new Label(rightComposite, SWT.None);
slaveHostLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
slaveViewer = new TableViewer(rightComposite, SWT.BORDER | SWT.FULL_SELECTION);
slaveViewer.getTable().setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 3, 1, -1, -1));
slaveViewer.getTable().setLinesVisible(true);
slaveViewer.getTable().setHeaderVisible(true);
slaveViewer.setContentProvider(new TableContentProvider());
slaveViewer.setLabelProvider(new CubridConfTableProvider());
slaveViewer.setColumnProperties(PROPS);
CellEditor[] editorsB = new CellEditor[2];
editorsB[0] = null;
editorsB[1] = new TextCellEditor(slaveViewer.getTable());
slaveViewer.setCellEditors(editorsB);
slaveViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
if (property.equals(PROPS[1])) {
return true;
}
return false;
}
public Object getValue(Object element, String property) {
DataModel model = (DataModel) element;
if (property.equals(PROPS[0])) {
return model.getKey() == null ? "" : model.getKey();
} else if (property.equals(PROPS[1])) {
return model.getValue() == null ? "" : model.getValue();
}
return "";
}
public void modify(Object element, String property, Object value) {
TableItem item = (TableItem) element;
DataModel model = (DataModel) item.getData();
model.setValue(value.toString());
slaveViewer.refresh(model);
updateHAModel(slaveViewer, model, false);
}
});
TableColumn keyBColumn = new TableColumn(slaveViewer.getTable(), SWT.LEFT);
keyBColumn.setText(Messages.lblKey);
keyBColumn.setWidth(160);
TableColumn valueBColumn = new TableColumn(slaveViewer.getTable(), SWT.LEFT);
valueBColumn.setText(Messages.lblValue);
valueBColumn.setWidth(200);
ToolBar toolBarB = new ToolBar(rightComposite, SWT.None);
toolBarB.setLayoutData(CommonUITool.createGridData(GridData.HORIZONTAL_ALIGN_END, 3, 1, -1, -1));
ToolItem addItemB = new ToolItem(toolBarB, SWT.None);
addItemB.setToolTipText(Messages.itemAddParameter);
addItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/add_param.gif"));
addItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
addParameter(slaveViewer);
}
});
ToolItem editItemB = new ToolItem(toolBarB, SWT.None);
editItemB.setToolTipText(Messages.itemEditParameter);
editItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/edit_param.gif"));
editItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
editParameter(slaveViewer);
}
});
ToolItem dropItemB = new ToolItem(toolBarB, SWT.None);
dropItemB.setToolTipText(Messages.itemDeleteParameter);
dropItemB.setImage(CubridManagerUIPlugin.getImage("/icons/replication/delete_param.gif"));
dropItemB.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
widgetDefaultSelected(e);
}
public void widgetDefaultSelected(SelectionEvent e) {
dropParameter(slaveViewer);
}
});
}
Aggregations