Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 259647 Details for
Bug 476913
[Cocoa] SWT on OSX: toolbar too high
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
simplified snippet
Application.java (text/x-java), 1.93 KB, created by
Lakshmi P Shanmugam
on 2016-02-09 02:03:50 EST
(
hide
)
Description:
simplified snippet
Filename:
MIME Type:
Creator:
Lakshmi P Shanmugam
Created:
2016-02-09 02:03:50 EST
Size:
1.93 KB
patch
obsolete
>import org.eclipse.swt.*; >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class Application { > > protected Shell shell; > private Display display; > private ToolBar toolBar; > > /** > * Launch the application. > * > * @param args > */ > public static void main(String[] args) { > try { > Application app = new Application(); > app.open(); > } catch (Exception e) { > e.printStackTrace(); > } > } > > /** > * Open the window. > */ > public void open() { > display = Display.getDefault(); > > createContents(); > > shell.open(); > shell.layout(); > shell.setMinimumSize(800, 600); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } > > /** > * Create contents of the window. > */ > protected void createContents() { > GridLayout layout = new GridLayout(1, false); > layout.marginHeight = 3; > layout.marginWidth = 3; > > shell = new Shell(); > shell.setSize(1000, 600); > shell.setLayout(layout); > > toolBar = shell.getToolBar(); > > ToolItem openTemplateItem = createToolbarButton("TOOLITEM_OPEN_TEMPLATE", "TOOLITEM_OPEN_TEMPLATE"); > openTemplateItem.addSelectionListener(new SelectionListener() { > @Override > public void widgetSelected(SelectionEvent paramSelectionEvent) { > } > > @Override > public void widgetDefaultSelected(SelectionEvent paramSelectionEvent) { > } > }); > > ToolItem checkItem = createToolbarButton("TOOLITEM_CHECK", "TOOLITEM_CHECK"); > checkItem.addSelectionListener(new SelectionListener() { > @Override > public void widgetSelected(SelectionEvent paramSelectionEvent) { > } > > @Override > public void widgetDefaultSelected(SelectionEvent paramSelectionEvent) { > } > }); > } > > private ToolItem createToolbarButton(String textId, String imageId) { > ToolItem item = new ToolItem(toolBar, SWT.PUSH); > Image image = new Image(display, "blueLetter.png"); > item.setImage(image); > return item; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 476913
:
256449
|
256450
|
259646
| 259647