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 165072 Details for
Bug 309443
[Forms] Section with zero size causes exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Test case
Application_1.java (text/plain), 1.97 KB, created by
Konstantin Scheglov
on 2010-04-16 05:33:39 EDT
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Konstantin Scheglov
Created:
2010-04-16 05:33:39 EDT
Size:
1.97 KB
patch
obsolete
>package test; > >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.ui.forms.widgets.FormToolkit; >import org.eclipse.ui.forms.widgets.Section; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.SWT; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Label; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; > >public class Application_1 { > protected Shell m_shell; > private final FormToolkit formToolkit = new FormToolkit(Display.getDefault()); > private Section m_section; > /** > * Launch the application. > * @param args > */ > public static void main(String[] args) { > try { > Application_1 window = new Application_1(); > window.open(); > } catch (Exception e) { > e.printStackTrace(); > } > } > /** > * Open the window. > */ > public void open() { > Display display = Display.getDefault(); > createContents(); > m_shell.open(); > m_shell.layout(); > while (!m_shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > } > /** > * Create contents of the window. > */ > protected void createContents() { > m_shell = new Shell(); > m_shell.setSize(450, 300); > m_shell.setText("SWT Application"); > m_shell.setLayout(new GridLayout(2, false)); > { > m_section = formToolkit.createSection(m_shell, Section.TWISTIE | Section.TITLE_BAR); > formToolkit.paintBordersFor(m_section); > m_section.setText("New Section"); > } > { > Button button = new Button(m_shell, SWT.NONE); > button.addSelectionListener(new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { > m_section.setSize(0, 0); > m_section.notifyListeners(SWT.Paint, null); > } > }); > formToolkit.adapt(button, true, true); > button.setText("New Button"); > } > } >}
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 309443
: 165072 |
165175
|
225136