use of com.novocode.naf.swt.custom.Hyperlink in project cubrid-manager by CUBRID.
the class JdbcOptionComposite method createButtonComp.
/**
*
* Create button composite
*
* @param composite the composite
*/
private void createButtonComp(Composite composite) {
Composite buttonComposite = new Composite(composite, SWT.NONE);
{
GridLayout layout = new GridLayout();
layout.numColumns = 3;
buttonComposite.setLayout(layout);
buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
}
Hyperlink link = new Hyperlink(buttonComposite, SWT.None);
link.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
link.setText(Messages.titleJdbcAdvancedOptionView);
link.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
try {
IWebBrowser br = browserSupport.createBrowser(null);
br.openURL(new URL(Messages.msgCubridJdbcInfoUrl));
} catch (Exception ignored) {
}
}
public void mouseDown(MouseEvent e) {
}
public void mouseDoubleClick(MouseEvent e) {
}
});
addButton = new Button(buttonComposite, SWT.PUSH);
addButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
addButton.setText(Messages.btnAdd);
addButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
TableItem itemNew = new TableItem(jdbcInfoTv.getTable(), SWT.SINGLE);
int newIndex = jdbcInfoTv.getTable().getItemCount() - 1;
focusCell(itemNew, newIndex, 0);
}
});
Button delButton = new Button(buttonComposite, SWT.PUSH);
delButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
delButton.setText(Messages.btnDelete);
delButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
TableItem[] selection = jdbcInfoTv.getTable().getSelection();
if (selection == null || selection.length == 0) {
return;
}
jdbcInfoTv.getTable().setSelection(-1);
for (TableItem item : selection) {
item.dispose();
}
}
});
}
use of com.novocode.naf.swt.custom.Hyperlink in project cubrid-manager by CUBRID.
the class GeneralInfoPage method createChartsetGroup.
/**
* Create chartset information group
*
* @param parent the parent composite
*/
private void createChartsetGroup(Composite parent) {
Group charsetGroup = new Group(parent, SWT.NONE);
charsetGroup.setText(Messages.grpCharsetInfo);
GridData gdCharsetGroup = new GridData(GridData.FILL_HORIZONTAL);
charsetGroup.setLayoutData(gdCharsetGroup);
GridLayout layoutCharsetGroup = new GridLayout();
layoutCharsetGroup.numColumns = 3;
charsetGroup.setLayout(layoutCharsetGroup);
enIsoRadio = new Button(charsetGroup, SWT.RADIO);
final GridData gdEnIsoRadio = new GridData(SWT.FILL, SWT.CENTER, true, false);
enIsoRadio.setLayoutData(gdEnIsoRadio);
enIsoRadio.setText(CHARSET_EN_US_ISO88591);
enIsoRadio.setSelection(true);
enUtfRadio = new Button(charsetGroup, SWT.RADIO);
final GridData gdEnUtfRadio = new GridData(SWT.FILL, SWT.CENTER, true, false);
enUtfRadio.setLayoutData(gdEnUtfRadio);
enUtfRadio.setText(CHARSET_EN_US_UTF8);
koEuckrRadio = new Button(charsetGroup, SWT.RADIO);
final GridData gdKoEuckrRadio = new GridData(SWT.FILL, SWT.CENTER, true, false);
koEuckrRadio.setLayoutData(gdKoEuckrRadio);
koEuckrRadio.setText(CHARSET_KO_KR_EUCKR);
koUtfRadio = new Button(charsetGroup, SWT.RADIO);
final GridData gdKoUtfRadio = new GridData(SWT.FILL, SWT.CENTER, true, false);
koUtfRadio.setLayoutData(gdKoUtfRadio);
koUtfRadio.setText(CHARSET_KO_KR_UTF8);
userDefinedRadio = new Button(charsetGroup, SWT.RADIO);
final GridData gdUserDefinedRadio = new GridData(SWT.FILL, SWT.CENTER, true, false);
koUtfRadio.setLayoutData(gdUserDefinedRadio);
userDefinedRadio.setText(Messages.lblUserDefinedCharset);
userDefinedRadio.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
Button btn = (Button) e.widget;
userDefinedCharsetText.setEnabled(btn.getSelection());
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
userDefinedCharsetText = new Text(charsetGroup, SWT.BORDER);
final GridData gdDetailCombo = new GridData(SWT.FILL, SWT.CENTER, true, false);
userDefinedCharsetText.setLayoutData(gdDetailCombo);
userDefinedCharsetText.setEnabled(false);
userDefinedCharsetText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
//TODO whether need check the input style?
valid();
}
});
Hyperlink link = new Hyperlink(charsetGroup, SWT.None);
GridData gdLink = new GridData(SWT.FILL, SWT.CENTER, true, false);
gdLink.horizontalSpan = 3;
link.setLayoutData(gdLink);
link.setText(Messages.msgLocaleManual);
link.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
try {
IWebBrowser br = browserSupport.createBrowser(null);
String url = Messages.msgLocaleManualUrl91;
if (CompatibleUtil.isAfter930(server.getServerInfo())) {
url = Messages.msgLocaleManualUrl93;
} else if (CompatibleUtil.isAfter920(server.getServerInfo())) {
url = Messages.msgLocaleManualUrl92;
}
br.openURL(new URL(url));
} catch (Exception ignored) {
}
}
});
}
Aggregations