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 73612 Details for
Bug 195735
Widget disposal causes NullPointerException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
example snippet
EntryPoint1.java (text/plain), 1.85 KB, created by
Benjamin Muskalla
on 2007-07-11 19:00:16 EDT
(
hide
)
Description:
example snippet
Filename:
MIME Type:
Creator:
Benjamin Muskalla
Created:
2007-07-11 19:00:16 EDT
Size:
1.85 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH. All rights > * reserved. This program and the accompanying materials are made available > * under the terms of the Eclipse Public License v1.0 which accompanies this > * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html > * Contributors: Innoopract Informationssysteme GmbH - initial API and > * implementation > ******************************************************************************/ >package org.eclipse.rap.demo; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.*; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.lifecycle.IEntryPoint; >import org.eclipse.swt.widgets.*; > >public class EntryPoint1 implements IEntryPoint { > > public Display createUI() { > Display display = new Display(); > final Shell shell = new Shell( display, SWT.SHELL_TRIM ); > shell.setLayout( new FillLayout() ); > shell.setBounds( 10, 10, 200, 100 ); > final Text text = new Text( shell, SWT.MULTI ); > > final Tree tree = new Tree( shell, SWT.SINGLE ); > for( int i = 0; i < 5; i++ ) { > TreeItem t1 = new TreeItem( tree, SWT.NONE ); > t1.setText( "foo" + i ); > } > > Button b1 = new Button( shell, SWT.PUSH ); > b1.setText( "dispose both (works not - text first)" ); > b1.addSelectionListener( new SelectionAdapter() { > > public void widgetSelected( SelectionEvent e ) { > text.dispose(); > tree.dispose(); > } > } ); > > Button b2 = new Button( shell, SWT.PUSH ); > b2.setText( "dispose both (works - tree first)" ); > b2.addSelectionListener( new SelectionAdapter() { > > public void widgetSelected( SelectionEvent e ) { > tree.dispose(); > text.dispose(); > } > } ); > shell.pack(); > shell.open(); > return display; > } >}
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 195735
:
73242
| 73612