use of org.eclipse.swt.widgets.Composite in project translationstudio8 by heartsome.
the class WebSearchPreferencePage method createTableCmdArea.
private Composite createTableCmdArea(Composite parent) {
Composite urlCmdArea = new Composite(parent, SWT.NONE);
GridLayout urlCmdArea_layout = new GridLayout(1, true);
urlCmdArea.setLayout(urlCmdArea_layout);
urlCmdArea.setLayoutData(new GridData(GridData.FILL_VERTICAL));
addItemBtn = new Button(urlCmdArea, SWT.NONE);
addItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.Add"));
editItemBtn = new Button(urlCmdArea, SWT.NONE);
editItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.edit"));
editItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
editItemBtn.setEnabled(false);
deleteItemBtn = new Button(urlCmdArea, SWT.NONE);
deleteItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.delete"));
deleteItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
deleteItemBtn.setEnabled(false);
upItemBtn = new Button(urlCmdArea, SWT.NONE);
upItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
upItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.upitem"));
upItemBtn.setEnabled(false);
downItemBtn = new Button(urlCmdArea, SWT.NONE);
downItemBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
downItemBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.downitem"));
downItemBtn.setEnabled(false);
importItemsBtn = new Button(urlCmdArea, SWT.NONE);
importItemsBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
importItemsBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.import"));
exportItemsBtn = new Button(urlCmdArea, SWT.NONE);
exportItemsBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
exportItemsBtn.setText(Messages.getString("Websearch.WebSearcPreferencePage.export"));
return urlCmdArea;
}
use of org.eclipse.swt.widgets.Composite in project translationstudio8 by heartsome.
the class LicenseAgreementDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite tparent = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginTop = 5;
layout.marginWidth = 10;
tparent.setLayout(layout);
GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true);
parentData.heightHint = 380;
tparent.setLayoutData(parentData);
Label lbl = new Label(tparent, SWT.NONE);
lbl.setText(Messages.getString("license.LicenseAgreementDialog.label"));
lbl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Text text = new Text(tparent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
text.setEditable(false);
text.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
text.setText(Messages.getString("license.LicenseAgreementDialog.agreement"));
GridData textData = new GridData(GridData.FILL_BOTH);
text.setLayoutData(textData);
agreeBtn = new Button(tparent, SWT.CHECK);
agreeBtn.setText(Messages.getString("license.LicenseAgreementDialog.agreeBtn"));
agreeBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
agreeBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getButton(IDialogConstants.OK_ID).setEnabled(agreeBtn.getSelection());
}
});
return super.createDialogArea(parent);
}
use of org.eclipse.swt.widgets.Composite in project translationstudio8 by heartsome.
the class LicenseManageDialog method createStatusComp.
private void createStatusComp(Composite parent) {
Group statusGroup = new Group(parent, SWT.NONE);
statusGroup.setText(Messages.getString("license.LicenseManageDialog.statusGroup"));
GridData dataStatusGroup = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
dataStatusGroup.heightHint = 150;
statusGroup.setLayoutData(dataStatusGroup);
statusGroup.setLayout(new GridLayout());
GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
RowLayout layout = new RowLayout();
layout.center = true;
Composite comp0 = new Composite(statusGroup, SWT.NONE);
comp0.setLayoutData(data);
comp0.setLayout(layout);
Label statusLbl = new Label(comp0, SWT.NONE);
statusLbl.setText(Messages.getString("license.LicenseManageDialog.statusLabel"));
if (type == Constants.STATE_NOT_ACTIVATED) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.notActiveLabel"));
} else if (type == Constants.STATE_VALID) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.activeLabel"));
new Label(comp0, SWT.NONE).setLayoutData(new RowData(30, SWT.DEFAULT));
Button btnCancelActive = new Button(comp0, SWT.NONE);
btnCancelActive.setText(Messages.getString("license.LicenseManageDialog.cancelActiveButton"));
btnCancelActive.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean result = MessageDialog.openConfirm(getShell(), Messages.getString("license.LicenseManageDialog.confirm"), Messages.getString("license.LicenseManageDialog.confirmMessage"));
if (result) {
try {
int re = ServiceUtil.cancel();
if (re == Constants.LOGOUT_SUCCESS) {
MessageDialog.openInformation(getShell(), Messages.getString("license.LicenseManageDialog.notice"), Messages.getString("license.LicenseManageDialog.unactiveSuccess"));
LicenseManageDialog.this.close();
PlatformUI.getWorkbench().restart();
} else {
MessageDialog.openInformation(getShell(), Messages.getString("license.LicenseManageDialog.notice"), Messages.getString("license.LicenseManageDialog.unactiveFail"));
}
} catch (Exception e1) {
e1.printStackTrace();
Throwable t = e1;
while (t.getCause() != null) {
t = t.getCause();
}
if (t instanceof java.security.cert.CertificateException) {
MessageDialog.openInformation(getShell(), Messages.getString("license.LicenseManageDialog.titleNet"), MessageFormat.format(Messages.getString("license.LicenseManageDialog.infoNet"), Constants.EXCEPTION_STRING16));
} else {
MessageDialog.openInformation(getShell(), Messages.getString("license.LicenseManageDialog.titleNet"), MessageFormat.format(Messages.getString("license.LicenseManageDialog.infoNet"), Constants.EXCEPTION_STRING17));
}
}
}
}
});
Composite comp1 = new Composite(statusGroup, SWT.NONE);
comp1.setLayoutData(data);
comp1.setLayout(layout);
Label typeLbl = new Label(comp1, SWT.NONE);
typeLbl.setText(Messages.getString("license.LicenseManageDialog.typeLabel"));
Label typeLbl1 = new Label(comp1, SWT.NONE);
typeLbl1.setText(Messages.getString(utilDate == null ? "license.LicenseManageDialog.typeBusiness" : "license.LicenseManageDialog.typeTemp"));
if (utilDate != null) {
Composite comp2 = new Composite(statusGroup, SWT.NONE);
comp2.setLayoutData(data);
comp2.setLayout(layout);
Label typeLbl2 = new Label(comp2, SWT.NONE);
typeLbl2.setText(Messages.getString("license.LicenseManageDialog.utilDate"));
Label dateLbl = new Label(comp2, SWT.NONE);
dateLbl.setText(utilDate);
}
} else if (type == Constants.STATE_INVALID) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.invalidLicense"));
} else if (type == Constants.STATE_EXPIRED) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.expired"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
comp1.setLayoutData(data);
comp1.setLayout(layout);
Label typeLbl = new Label(comp1, SWT.NONE);
typeLbl.setText(Messages.getString("license.LicenseManageDialog.typeLabel"));
Label typeLbl1 = new Label(comp1, SWT.NONE);
typeLbl1.setText(Messages.getString(utilDate == null ? "license.LicenseManageDialog.typeBusiness" : "license.LicenseManageDialog.typeTemp"));
if (utilDate != null) {
Composite comp2 = new Composite(statusGroup, SWT.NONE);
comp2.setLayoutData(data);
comp2.setLayout(layout);
Label typeLbl2 = new Label(comp2, SWT.NONE);
typeLbl2.setText(Messages.getString("license.LicenseManageDialog.utilDate"));
Label dateLbl = new Label(comp2, SWT.NONE);
dateLbl.setText(utilDate);
}
} else if (type == Constants.EXCEPTION_INT16 || type == Constants.EXCEPTION_INT17) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.unvalidate"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
GridData data1 = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_BOTH);
comp1.setLayoutData(data1);
GridLayout layout1 = new GridLayout();
comp1.setLayout(layout1);
Label noticeLbl = new Label(comp1, SWT.WRAP);
GridData dataLabel = new GridData(GridData.FILL_HORIZONTAL);
noticeLbl.setLayoutData(dataLabel);
noticeLbl.setText(MessageFormat.format(Messages.getString("license.LicenseManageDialog.noticeLbl"), StringUtils.getErrorCode(type)));
} else if (type == Constants.EXCEPTION_INT14) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.licenseException"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
GridData data1 = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_BOTH);
comp1.setLayoutData(data1);
GridLayout layout1 = new GridLayout();
comp1.setLayout(layout1);
Label noticeLbl = new Label(comp1, SWT.WRAP);
GridData dataLabel = new GridData(GridData.FILL_HORIZONTAL);
noticeLbl.setLayoutData(dataLabel);
noticeLbl.setText(MessageFormat.format(Messages.getString("license.LicenseManageDialog.noSameVersion"), getVersionContent(System.getProperty("TSEdition")), getVersionContent(new LicenseIdGenerator(licenseId).getVersion())));
} else if (type == Constants.EXCEPTION_INT15) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.licenseException"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
GridData data1 = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_BOTH);
comp1.setLayoutData(data1);
GridLayout layout1 = new GridLayout();
comp1.setLayout(layout1);
Label noticeLbl = new Label(comp1, SWT.WRAP);
GridData dataLabel = new GridData(GridData.FILL_HORIZONTAL);
noticeLbl.setLayoutData(dataLabel);
noticeLbl.setText(Messages.getString("license.LicenseManageDialog.maccodeError"));
} else if (type == Constants.EXCEPTION_INT1 || type == Constants.EXCEPTION_INT2 || type == Constants.EXCEPTION_INT3 || type == Constants.EXCEPTION_INT4) {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.licenseException"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
GridData data1 = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_BOTH);
comp1.setLayoutData(data1);
GridLayout layout1 = new GridLayout();
comp1.setLayout(layout1);
Label noticeLbl = new Label(comp1, SWT.WRAP);
GridData dataLabel = new GridData(GridData.FILL_HORIZONTAL);
noticeLbl.setLayoutData(dataLabel);
noticeLbl.setText(MessageFormat.format(Messages.getString("license.LicenseManageDialog.licenseExceptionInfo1"), StringUtils.getErrorCode(type)));
} else {
Label statusLbl1 = new Label(comp0, SWT.NONE);
statusLbl1.setText(Messages.getString("license.LicenseManageDialog.licenseException"));
Composite comp1 = new Composite(statusGroup, SWT.NONE);
GridData data1 = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_BOTH);
comp1.setLayoutData(data1);
GridLayout layout1 = new GridLayout();
comp1.setLayout(layout1);
Label noticeLbl = new Label(comp1, SWT.WRAP);
GridData dataLabel = new GridData(GridData.FILL_HORIZONTAL);
noticeLbl.setLayoutData(dataLabel);
noticeLbl.setText(MessageFormat.format(Messages.getString("license.LicenseManageDialog.licenseExceptionInfo"), StringUtils.getErrorCode(type)));
}
}
use of org.eclipse.swt.widgets.Composite in project translationstudio8 by heartsome.
the class LicenseManageDialog method createBarComp.
private void createBarComp(Composite parent) {
Composite barComp = new Composite(parent, SWT.NONE);
GridLayout barLayout = new GridLayout();
barLayout.marginTop = 10;
barComp.setLayout(barLayout);
barComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
label4 = new Label(barComp, SWT.NONE);
label4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
bar = new ProgressBar(barComp, SWT.NONE);
bar.setMaximum(10);
bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setVisible(false);
}
use of org.eclipse.swt.widgets.Composite in project translationstudio8 by heartsome.
the class LicenseManageDialog method createActiveComp.
private void createActiveComp(Composite parent) {
Group licenseIdGroup = new Group(parent, SWT.NONE);
licenseIdGroup.setText(Messages.getString("license.LicenseManageDialog.licenseIdGroup"));
GridData dataLicenseIdGroup = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
dataLicenseIdGroup.heightHint = 110;
licenseIdGroup.setLayoutData(dataLicenseIdGroup);
GridLayout layoutGroup = new GridLayout(2, false);
layoutGroup.marginLeft = 5;
layoutGroup.marginHeight = 10;
licenseIdGroup.setLayout(layoutGroup);
Label label = new Label(licenseIdGroup, SWT.NONE);
label.setText(Messages.getString("license.LicenseManageDialog.licenseIdLabel"));
createIdInputComp(licenseIdGroup);
Composite compLink = new Composite(licenseIdGroup, SWT.NONE);
RowLayout layoutLink = new RowLayout();
layoutLink.marginTop = 20;
layoutLink.marginRight = 0;
layoutLink.marginLeft = 0;
layoutLink.marginBottom = 10;
compLink.setLayout(layoutLink);
GridData linkData = new GridData(GridData.FILL_HORIZONTAL);
linkData.horizontalSpan = 2;
compLink.setLayoutData(linkData);
Label label1 = new Label(compLink, SWT.NONE);
label1.setText(Messages.getString("license.LicenseManageDialog.label1"));
if (!"L".equals(System.getProperty("TSEdition"))) {
Label link1 = new Label(compLink, SWT.NONE);
link1.setText(Messages.getString("license.LicenseManageDialog.link1"));
link1.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
link1.setCursor(cursor);
link1.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
}
public void mouseDown(MouseEvent e) {
Program.launch(Messages.getString("license.LicenseManageDialog.urlr8buy") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
}
public void mouseDoubleClick(MouseEvent e) {
}
});
Label label2 = new Label(compLink, SWT.NONE);
label2.setText(Messages.getString("license.LicenseManageDialog.label2"));
}
Label link2 = new Label(compLink, SWT.NONE);
link2.setText(Messages.getString("license.LicenseManageDialog.link2"));
link2.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
link2.setCursor(cursor);
link2.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
}
public void mouseDown(MouseEvent e) {
Program.launch(Messages.getString("license.LicenseManageDialog.urlr8trial") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
}
public void mouseDoubleClick(MouseEvent e) {
}
});
Label label3 = new Label(compLink, SWT.NONE);
label3.setText(Messages.getString("license.LicenseManageDialog.label3"));
}
Aggregations