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 146158 Details for
Bug 288221
[Viewers] CellEditor's createControl(..) method called in constructor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
TestCase
patch_Bug_TestCase.txt (text/plain), 3.15 KB, created by
Hitesh
on 2009-09-01 04:03:53 EDT
(
hide
)
Description:
TestCase
Filename:
MIME Type:
Creator:
Hitesh
Created:
2009-09-01 04:03:53 EDT
Size:
3.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestCellEditorCreation.java >=================================================================== >RCS file: Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestCellEditorCreation.java >diff -N Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestCellEditorCreation.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestCellEditorCreation.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,112 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 IBM Corporation and others. >+ * 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: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.jface.tests.viewers; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.jface.viewers.CellEditor; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; >+ >+/** >+ * @since 3.5 >+ * >+ */ >+public class TestCellEditorCreation extends TestCase{ >+ >+ /** >+ * @param testName >+ */ >+ /*public TestCellEditorCreation(String testName) { >+ super(); >+ >+ }*/ >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ >+ // ensure we've initialized a display for this thread >+ Display.getDefault(); >+ } >+ >+ >+ public void testCreation(){ >+ try{ >+ Shell shell=new Shell(Display.getDefault()); >+ shell.open(); >+ new FailingCellEditor(shell); >+ >+ }catch(Exception e){ >+ fail("TestCellEditorCreation.testCreation() failed: " +e); >+ } >+ } >+ >+ private class FailingCellEditor extends CellEditor{ >+ >+ private Object[] values; >+ >+ /** >+ * @param shell >+ */ >+ public FailingCellEditor(Shell shell) { >+ super(shell); >+ values=new Object[3]; >+ } >+ >+ /* >+ * Call initialise in supers const >+ */ >+ >+ /*protected void initialise(){ >+ >+ }*/ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.CellEditor#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createControl(Composite parent) { >+ getMyValue(); >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.CellEditor#doGetValue() >+ */ >+ protected Object doGetValue() { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.CellEditor#doSetFocus() >+ */ >+ protected void doSetFocus() { >+ >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.CellEditor#doSetValue(java.lang.Object) >+ */ >+ protected void doSetValue(Object value) { >+ >+ } >+ private Object getMyValue(){ >+ if(values[1]==null){ >+ values[1]=new Object(); >+ } >+ return values[1]; >+ } >+ } >+ >+ >+}
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 288221
: 146158