Bug 239754 - "run as Midlet" appears on a non-midlet
Summary: "run as Midlet" appears on a non-midlet
Status: CLOSED FIXED
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All Windows XP
: P3 normal (vote)
Target Milestone: 0.9   Edit
Assignee: Gustavo de Paula CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, ui, usability
Depends on:
Blocks:
 
Reported: 2008-07-07 02:16 EDT by Feng(Marvin) Wang CLA
Modified: 2008-10-15 09:23 EDT (History)
2 users (show)

See Also:


Attachments
"run as Midlet" appears on a non-midlet (26.26 KB, image/jpeg)
2008-07-07 02:16 EDT, Feng(Marvin) Wang CLA
no flags Details
patch for this bug (1.26 KB, patch)
2008-07-09 20:57 EDT, Feng(Marvin) Wang CLA
wds057: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Feng(Marvin) Wang CLA 2008-07-07 02:16:41 EDT
Created attachment 106685 [details]
"run as Midlet" appears on a non-midlet

When you start up MTJ, and right click any resource (project, folder, and file) and select ¡®run as/debug as¡¯, you will see ¡®Emulated Java ME MIDlet¡¯ menu. After the first time you use ¡®run/debug as MIDlet¡¯, the ¡®Emulated Java ME MIDlet¡¯ option will just appear on Midlet.
This is because when you start MTJ, the org.eclipse.mtj.ui plug-in will not active until the first time you use it. So the propertyTester extensions in org.eclipse.mtj.ui will not function until the first time you use it. 
Possible solutions:
1.	Set attribute forcePluginActivation="true" of <test> element in org.eclipse.debug.ui.launchShortcuts extentions.
Like this:
   <extension
         point="org.eclipse.debug.ui.launchShortcuts">
............
<test property="org.eclipse.mtj.ui.javaElement.isMidlet" forcePluginActivation="true"/>
............
2.	Use JDT build-in property tester, like this:
<extension
         point="org.eclipse.debug.ui.launchShortcuts">
............
		             <and>
		               <adapt type="org.eclipse.jdt.core.IJavaElement">
		                 <test property="org.eclipse.jdt.core.isInJavaProject" forcePluginActivation="true"/>
		               </adapt>
		               <test property="org.eclipse.jdt.launching.extendsClass" args="javax.microedition.midlet.MIDlet"/>
		              </and>
............

I think the second solution is better.
Comment 1 Feng(Marvin) Wang CLA 2008-07-09 20:57:21 EDT
Created attachment 107024 [details]
patch for this bug

If apply this patch, the org.eclipse.mtj.ui.internal.MidletPropertyTester class will no longer useful.
Comment 2 Gustavo de Paula CLA 2008-07-10 08:58:46 EDT
hi feng,

just reviewed the change. i will commit to the repository today

:)
gep
 
(In reply to comment #1)
> Created an attachment (id=107024) [details]
> patch for this bug
> 
> If apply this patch, the org.eclipse.mtj.ui.internal.MidletPropertyTester class
> will no longer useful.
> 

Comment 3 Feng(Marvin) Wang CLA 2008-07-11 03:54:44 EDT
Hi gep,

I found the patch contains something not useful. It is forcePluginActivation="true", this attribute is of no use. You can easily find it in the path in this line:
<test property="org.eclipse.jdt.core.isInJavaProject" forcePluginActivation="true"/>

Would you pls delete this attribute and commit again?

After delete, the line will like this:
<test property="org.eclipse.jdt.core.isInJavaProject"/>
Comment 4 Gustavo de Paula CLA 2008-07-11 11:15:14 EDT
just commited to svn

thanks feng
:)
gep
Comment 5 Gustavo de Paula CLA 2008-10-15 09:23:20 EDT
all bugs we integrated and release on MTj 0.9