I've got two questions:
- How I can to know the type of the current platform in code? Is it Mac or Linux or Windows.
- Is there something in SWT?
You can use:
String platform = SWT.getPlatform();
which returns "win32", "motif", "gtk", "photon", "carbon", "cocoa", "wpf" ...
It is rare to actually need to use this.
// handle "Ctrl+Z" : undo
tw.addKeyListener(new KeyStrokeAdapter("Ctrl+z") {
@Override
protected void onAction() {
getUndoManager().undo();
}
});
end for mac I mast replace the Ctrl+Z to cmd+z
– Pavel Kopychenko
Sep 03 '14 at 14:21