I tried moving to php5, I am getting into lot of issues. This class gives error :
Class DatabaseConnection
{ // error here
private $connection;
private $result;
//
public function __construct()
{
$this->databaseName = $GLOBALS['configuration']['db'];
}
// other methods follow
}
I want to provide some template for a code generator I am developing. A typical pattern for class is :
public ${class_type} ${class_name} extends ${super_class} implements ${interfaces} {
${class_body}
}
Problem is if super_class is blank or interfaces. I replace extends ${super_class} with empty string. But I get extra spaces. So a class with no super_class and interfaces end up like :
public class Foo { //see the extra spaces before {?
${class_body}
}
I know I can replace multiple spaces with single, but is there any better approach?
When I am parsing an xml string as below I get strange attributes like "autowire" with value "default". Is there anyway I can get the attribute that are explicitly defined?
<bean id="aaaa" class="com.test.Service">
<property name="cccc" ref="cccc"/>
</bean>
I am trying to put all the projects in the combo, but I get "External Plugin Libraries" as shown in the picture below. How am I getting this as project which I don't have. How do I get rid of it?
I am trying to put all the projects in the combo, but I get "External Plugin Libraries" as shown in the picture below. How am I getting this as project which I don't have. How do I get rid of it?
I want to change the values on one ComboFieldEditor depending on another ComboFieldEditor in an eclipse plugin. E.g. if the user changes the package, different classes need to be populated in the second ComboFieldEditor. The ComboFieldEditor class does not seem to to have a way to change the items on the fly.
Does anyone overload the equals method in java? The overloaded method will be
public boolean equals(final MyClass myClass)
This will have the benefit of having the relevant comparison part (guts of the method) in another method.
Details are in this blog.
I put a list strings as validTypes in velocity. When I do :
#if (${validTypes}.contains("aaa"))
// do something
#end
it throws an error. But when I do :
#foreach (${validType} in ${validTypes})
${validType}
#end
it works fine. Do I need to use velocity tools for this? How do I use it in an eclipse plugin?
Are there any work around without using velocity tools?
If I have handle to file how do I create a document and write to it? Right now, I am having to delete the file completely and recreate with new content as shown below :
IFile file = getFile();
file.delete();
file.create(input, false, null);
Can I make the spring service classes final? Is there any harm doing that? Nobody is going to extend the class. Is there any issue?
public final class MyService {
// Depedencies go here.
}
I am writing an eclipse plugin. How do I get the various images from eclipse library? So I don't have have keep a local set of images for the standard entities, e.g classes, interfaces, junits, etc.
EDIT : I used PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE) from the article : http://www.eclipse.org/articles/Article-Using%20Images%20In%20Eclipse/Using%20Images%20In%20Eclipse.html.
That did not work.
I have this dtd : http://fast-code.sourceforge.net/template.dtd
But when I include in an xml I get the warning :
No grammar constraints (DTD or XML schema) detected for the document.
The xml is :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE templates PUBLIC "//UNKNOWN/" "http://fast-code.sourceforge.net/template.dtd">
<templates>
<template type="type">
<description>Some</description>
<variation></variation>
<variation-field></variation-field>
<allow-multiple-variation></allow-multiple-variation>
<class-pattern></class-pattern>
<getter-setter>setter</getter-setter>
<allowed-file-extensions>java</allowed-file-extensions>
<number-required-classes>1</number-required-classes>
<template-body>
<![CDATA[
Some Data
]]>
</template-body>
</template>
</templates>
Any clue?
I put a list strings as validTypes in velocity. When I do :
#if (${validTypes}.contains("aaa"))
// do something
#end
it throws an error. But when I do :
#foreach (${validType} in ${validTypes})
${validType}
#end
it works fine. Do I need to use velocity tools for this? How do I use it in an eclipse plugin?
Are there any work around without using velocity tools?
Looks like set does not work in velocity when written as below :
#set (${modifier} = "some")
It works if I do #set ($modifier = "some"). Any reason for this?
Am I only one complaining? It will be nice to go to error (Ctrl . takes to warnings and error). Also nice to able to do Auto complete a statement. Any other ideas?