Skip to content

Commit

Permalink
509291: Date component with default style must be fixed on Mac
Browse files Browse the repository at this point in the history
Change-Id: I591de3983a92ed5656e8436adeea524bbaa68086
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=509291
  • Loading branch information
LorenzoBettini committed Dec 15, 2016
1 parent b1e6616 commit b31a685
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public DateTime createDateTime(int... styles) {

@Override
public DateTime createDateTime(Composite parent) {
return createDateTime(parent, SWT.DROP_DOWN);
return createDateTime(parent, SWT.DATE | SWT.DROP_DOWN);
}

@Override
Expand Down
1 change: 1 addition & 0 deletions tests/org.eclipse.emf.parsley.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="src" path="icons"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="src" path="snippets"/>
<classpathentry kind="output" path="bin"/>
</classpath>
3 changes: 2 additions & 1 deletion tests/org.eclipse.emf.parsley.tests/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
source.. = src/,\
xtend-gen/,\
icons/,\
resources/
resources/,\
snippets/
output.. = bin/
bin.includes = META-INF/,\
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package snippet;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SnippetBug509291 {
public static void main(String[] args) {

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new RowLayout());

@SuppressWarnings("unused")
DateTime dateTime = new DateTime(shell, SWT.DATE | SWT.DROP_DOWN);
// specify also SWT.DATE, otherwise, on Mac, it won't work:
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=509291

shell.pack();
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}

display.dispose();
}
}

0 comments on commit b31a685

Please sign in to comment.