use of org.eclipse.swt.events.MouseEvent 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"));
}
use of org.eclipse.swt.events.MouseEvent in project translationstudio8 by heartsome.
the class OfflineActiveDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite tparent = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginTop = 10;
tparent.setLayout(layout);
GridDataFactory.fillDefaults().grab(true, true).applyTo(tparent);
Composite compNav = new Composite(tparent, SWT.NONE);
GridLayout navLayout = new GridLayout();
compNav.setLayout(navLayout);
createNavigation(compNav);
Group groupLicenseId = new Group(tparent, SWT.NONE);
groupLicenseId.setText(Messages.getString("license.OfflineActiveDialog.licenseIdGroup"));
GridDataFactory.fillDefaults().grab(true, true).applyTo(groupLicenseId);
GridLayout layoutGroup = new GridLayout(2, false);
layoutGroup.marginLeft = 5;
layoutGroup.marginHeight = 100;
groupLicenseId.setLayout(layoutGroup);
Label label = new Label(groupLicenseId, SWT.NONE);
label.setText(Messages.getString("license.LicenseManageDialog.licenseIdLabel"));
createIdInputComp(groupLicenseId);
Composite compLink = new Composite(groupLicenseId, 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) {
}
});
} else {
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"));
return tparent;
}
use of org.eclipse.swt.events.MouseEvent in project otertool by wuntee.
the class LoadApkFromDeviceDialog method createContents.
/**
* Create contents of the dialog.
*/
private void createContents() {
shlSelectApk = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
shlSelectApk.setSize(592, 486);
shlSelectApk.setText("Select APK");
shlSelectApk.setLayout(new GridLayout(1, false));
table = new Table(shlSelectApk, SWT.BORDER | SWT.FULL_SELECTION);
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent arg0) {
result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
shlSelectApk.close();
}
});
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
table.setBounds(0, 0, 3, 19);
table.setHeaderVisible(true);
table.setLinesVisible(true);
final TableColumn tblclmnApk = new TableColumn(table, SWT.NONE);
tblclmnApk.setWidth(240);
tblclmnApk.setText("APK");
final TableColumn tblclmnPackage = new TableColumn(table, SWT.NONE);
tblclmnPackage.setWidth(338);
tblclmnPackage.setText("Package");
final String[] keys = { PACKAGE_BEAN };
GuiWorkshop.addColumnSorter(table, tblclmnApk, 0, keys);
GuiWorkshop.addColumnSorter(table, tblclmnPackage, 1, keys);
Composite composite = new Composite(shlSelectApk, SWT.NONE);
composite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
composite.setBounds(0, 0, 64, 64);
GridLayout gl_composite = new GridLayout(2, false);
gl_composite.verticalSpacing = 0;
gl_composite.marginWidth = 0;
gl_composite.marginHeight = 0;
gl_composite.horizontalSpacing = 0;
composite.setLayout(gl_composite);
Button btnLoad = new Button(composite, SWT.NONE);
btnLoad.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
if (table.getSelection().length == 0) {
GuiWorkshop.messageError(shlSelectApk, "Please Select an APK to load.");
} else {
result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
shlSelectApk.close();
}
}
});
btnLoad.setText("Load");
Button btnCancel = new Button(composite, SWT.NONE);
btnCancel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
result = null;
shlSelectApk.close();
}
});
btnCancel.setText("Cancel");
}
use of org.eclipse.swt.events.MouseEvent in project yyl_example by Relucent.
the class HelloCanvasArrow method open.
public void open() {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setLayout(new FillLayout());
final Canvas canvas = new Canvas(shell, SWT.NONE);
canvas.setCursor(SWTResourceManager.getCursor(SWT.CURSOR_ARROW));
canvas.addMouseListener(new MouseListener() {
public void mouseDoubleClick(MouseEvent arg0) {
}
public void mouseDown(MouseEvent e) {
p[0] = e.x;
p[1] = e.y;
b = true;
}
public void mouseUp(MouseEvent arg0) {
if (b) {
int[] tp = new int[4];
tp[0] = p[0];
tp[1] = p[0];
tp[2] = p[0];
tp[3] = p[3];
}
b = false;
}
});
canvas.addMouseMoveListener(new MouseMoveListener() {
public void mouseMove(MouseEvent e) {
p[2] = e.x;
p[3] = e.y;
canvas.redraw();
}
});
canvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent paintevent) {
if (b) {
paintArrow(paintevent.gc, new Point(p[0], p[1]), new Point(p[2], p[3]));
}
}
});
shell.setText("test");
shell.setSize(300, 300);
shell.layout();
shell.open();
while (!shell.isDisposed()) if (!display.readAndDispatch())
display.sleep();
}
use of org.eclipse.swt.events.MouseEvent in project tdi-studio-se by Talend.
the class ReviewComponentDialog method createRatingComp.
private void createRatingComp(Composite parent) {
initImages();
final Composite rateBtnComp = new Composite(parent, SWT.NONE);
final GridLayout rateLayout = new GridLayout();
rateLayout.numColumns = 5;
rateBtnComp.setLayout(rateLayout);
rateBtnComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
for (int i = 0; i < 5; i++) {
final Button rateButton = new Button(rateBtnComp, SWT.NONE);
rateButton.setLayoutData(new GridData(30, SWT.DEFAULT));
rateButton.setImage(imageMap.get(1));
rateButton.setData(0);
rateBtnMap.put(i, rateButton);
rateButton.addMouseTrackListener(new MouseTrackListener() {
public void mouseHover(MouseEvent e) {
handleMouseHover(rateButton);
}
public void mouseExit(MouseEvent e) {
handleMouseExit(rateButton);
}
public void mouseEnter(MouseEvent e) {
}
});
rateButton.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
}
public void mouseDown(MouseEvent e) {
handleMouseDown(rateButton);
checkInput();
}
public void mouseDoubleClick(MouseEvent e) {
}
});
}
rateLabel = new Label(parent, SWT.NONE);
rateLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
rateLabel.setText("Please select your rating*");
}
Aggregations