Fix for issue 134497 - run file on Application

0 views
Skip to first unread message

Ståle Undheim

unread,
Mar 21, 2009, 2:24:45 AM3/21/09
to scala-netbeans
I have made a fix for issue 134497 to better support the run file
option for a project. Now I just need to know where to upload the
file. I don't seem to have an option to attach files in the netbeans
issuezilla, nor can I add attachments here.

So, where do I put my bundle so it gets added to the Netbeans contrib
project?

Ståle Undheim

unread,
Mar 21, 2009, 2:27:42 AM3/21/09
to scala-netbeans
Of course figured this out after posting:

http://www.netbeans.org/issues/show_bug.cgi?id=134497

Caoyuan

unread,
Mar 21, 2009, 3:45:11 AM3/21/09
to scala-n...@googlegroups.com
Thanks. I''ll add your patch.

-Caoyuan

Caoyuan

unread,
Apr 11, 2009, 8:24:03 AM4/11/09
to scala-netbeans
Hi staale,

your patches has been applied at: 8fe006d9f245

Thanks.

On Mar 21, 3:45 pm, Caoyuan <dcaoy...@gmail.com> wrote:
> Thanks. I''ll add your patch.
>
> -Caoyuan
>

watchingthecrash

unread,
Apr 14, 2009, 10:07:03 PM4/14/09
to scala-netbeans
Caoyuan,

Any near term plans to release a new version of your plug-in with this
fix?

Caoyuan

unread,
Apr 14, 2009, 10:40:58 PM4/14/09
to scala-n...@googlegroups.com
Hi,

I plan to release a new version for NetBeans 6.7 (scheduled around
Jun). The new release is based on my own experience of using Scala for
NetBeans and some bug reports.

watchingthecrash

unread,
Apr 16, 2009, 9:05:03 AM4/16/09
to scala-netbeans
Thanks for the response Caoyuan.

Anyone else who might be writing many small standalone programs to
learn Scala, I've written the Scala program below (my first) that
allows them to be easily run in Netbeans while waiting for Caoyuan's
updated plugin. Compile it with the -Xno-varargs-conversion option
and set it as the main class in Netbeans. When run, it prompts for
the class to invoke in the "Output" area. Just type in a
package.class name.

import java.lang.reflect.Modifier
import java.lang.reflect.Method
import java.util.Scanner

object run extends Application
{
var debug = false
println("type class name to run: ")

if (!invoke(new Scanner(System.in).nextLine()))
println("main not found")

def invoke(fileName: String): Boolean =
{
var invoked = false
try
{
for ( m <- Class.forName(fileName).getDeclaredMethods)
{
if (debug)
printStuff(m)
val modString = Modifier.toString(m.getModifiers)
val parms = m.getParameterTypes
if ((parms.length == 1) &&
(m.getReturnType == classOf[Unit]) &&
( parms(0).isArray()) &&
(parms(0).getComponentType() == classOf[String])
&&
(modString.equals("public static final")) &&
m.getName().equals("main"))
{
m.invoke(null, new Array[String](0)) // dummy
parms
invoked = true
}
}
}
catch
{
case y: ClassNotFoundException => println(y)
case x: Exception => x.printStackTrace
}
invoked
}

def printStuff(m: Method) : Unit =
{
format("%s%n", m.toGenericString());
format(" Simple Name: %s%n", m.getName())
format(" Modifiers: %s%n",
Modifier.toString(m.getModifiers()));
format(" Return Type: %s%n", m.getReturnType)
format(" [ synthetic=%-5b var_args=%-5b bridge=%-5b ]%n",
m.isSynthetic(), m.isVarArgs(), m.isBridge());
}
}


On Apr 14, 10:40 pm, Caoyuan <dcaoy...@gmail.com> wrote:
> Hi,
>
> I plan to release a new version for NetBeans 6.7 (scheduled around
> Jun). The new release is based on my own experience of using Scala for
> NetBeans and some bug reports.
>
> On Wed, Apr 15, 2009 at 10:07 AM, watchingthecrash
>
Reply all
Reply to author
Forward
0 new messages