Specifying other Path to ResourceBundle / i18n for Vaadin - plugins

Is it possible to specify another path than the classpath for the properties files of Vaadin MVP plugin?
My main objective is to try to decouple these properties files at e.g. live deployment of the product being developed.

The plugin uses ResourceBundle.getBundle(baseName, locale) internally in the ResourceBundleUiMessageSource class. This means that it only looks at the class path and you cannot specify arbitrary locations externally.
However, all source code is included with the plugin, so you can extend it to use PropertyResourceBundle. See this question for more details.

Related

How to distinguish wizards in Eclipse RCP?

We have an Eclipse IDE application on 3.x that uses various newWizards to allow the user to create different files. Although these files differ slightly contentwise, the structure of the wizards is quite similar.
Thus, a sound object-oriented approach would be to instantiate different wizards from the same class and initialize them with different data.
Problem:
To decide what wizard needs which data we need a way to distinguish the different already instantiated wizards (e.g during the call to the init method of the wizard).
Is there any way to do so? It would e.g. help if somebody knows a way to get the wizard's id defined in the extension point from within the instantiated wizard.
If your wizard implements IExecutableExtension, it will be passed the configuration element that represents the extension for which it is created.
You can also use extension factories in that you specify a type that implements IExecutableExtensionFactory.
The interface allows you to control how the instances provided to extension-points (wizards in your case) are created.
Extension example:
<extension point="org.eclipse.ui.wizards">
<newWizard
name="..."
class="com.example.WizardFactory">
</newWizard>
Note that the extension factory may also implement IExecutableExtension to gain access to extension attributes before creating the extension's executable class.

Reference between two ecore

I have A.ecore in which I created classes and ORBAC.ecore in which there is rules and permissions classes
How can I make a reference so that a class from A.ecore can refer to class permission from ORBAC.ecore
Using the Ecore editor, open A.ecore
then right click, Load Resource...
you will have the possibility to load ORBAC.ecore (Browse Target Platform package, Registered Packages, File system or Workspace)
Once loaded, you'll be free to make references to classes defined in ORBAC.ecore.
Please note that the whay you load the additional resource may have some impacts when deploying your metamodels (and containing plugins). This is because Eclipse will use different URI scheme. (platform:/resource/..., platform:/plugin/..., registered nsUri, ...)

GWT Library creation

I have a gwt library which I include to my other project via:
inherits name="org.mylib.Mylib" />
All the classes in the library project is under org.mylib.client*
This works fine.
However I added packages that contains classes that I want to be included in the library, i.e to be called within a GWT client side code.
Will it work if I don't put the classes under org.mylib.client?
Packages like: x.io, x.nio etc. to be usable within a GWT client side code.
They need to be Java source files, not just classes. You may have meant this, but that part of your question is ambiguous.
Assuming they are sources, you do need to include them in a package that you've declared to GWT contains sources. Either by inheriting a module which has this, or by adding it yourself in your main module. In short, somewhere you need this:
<source path="/mySourcePath" />
where /mySourcePath is the location of the sources for this x.io pckage.

user spcific packages with gwt client side

I am a newbie at GWT and I have the following query.
I have a scenario where I am trying to develop a web interface(using GWT) for an existing application.
In the client side class file I would like to invoke a user specific class file, i understand that this is due to the fact that i am trying to invoke classes other than the ones http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
I would like to know how this code can be called from the client side of the ui.
Thanks and Regards,
Bhavya
If you have a source code for the class you want to use and it is using only the supported Java classes, you can simply add your specific classes to client packages. If this is a reusable code, you can create a new GWT module and inherit it in your application. You can also simply move those classes to your client packages OR add a new client folder in you .gwt.xml file (add one more <source> tag)
If your class is not compilable by GWT, then I think you need to use it through RPC service.
If the code is translatable into JavaScript, you could for example put your individual class files into a jar and add it to the Build Path - as you would do in a 'regular' Java Project.

Netbeans: using GUI Builder on regular Java class file

I'm using Netbeans. When I create a Java class, I sometimes want to change it to be a GUI component so that I can visually edit it using the GUI Builder.
What is the necessary step to transform a regular Java class to a GUI component so that Netbeans would recognize it and allow me to use GUI Builder ? (i.e. switch between Source and Design)
NetBeans' Gui builder, Matisse, works off a .form xml file located adjacent to the source file. Matisse creates and maintains the .form file and the code generator creates/updates methods in the java source to reflect changes to the form.
Unfortunately, there is no support in NetBeans for free-form GUI construction.
The closest I've seen is FormGenerator. It's a contributed NetBeans module that adds a right click action to .java files that will attempt to generate a .form file from the .java source. It's very limited, but it's better than nothing. It works best if you've followed the coding style employed by Matisse.
http://netbeans.org/projects/contrib/downloads/download/Readme.txt
http://netbeans.org/projects/contrib/downloads/download/FormGeneratorModule.zip
To add a class to the Palette, all that's needed is for your class to conform to the Java Beans model. That is, your class must:
be serializable
have a public, no-argument constructor.
All fields that have getter and setter methods that are named properly, i.e.:
int count
int getCount()
void setCount(int c)
should by default be recognized as a property.
For a finer control of what properties should and should not be exposed to the GUI Builder, you can associate your class with an implementation of the BeanInfo interface. See this Sun tutorial for more details.
However, NetBeans has several tools to help you in designing a custom bean. You can create new beans using the built-in templates available in the new file dialog, under the "JavaBeans Objects" folder.
This tutorial will guide you through creating an Image Bean.
What you could do is create one from scratch, design it as you wish, and then look at the generated code to understand how you can modify your existing class.
Try to use properties (Java bean!) for properties which should be changed from the ui designer and look here for more info.