I got a fairly simple question, but I cannot find anything that helps.
I am building an Eclipse RCP application which does NOT have to be localized in different languages. In fact: I want it to just offer an English UI.
So, all my views, editors, menus are nicely only displayed in English the way I want it.
BUT: I use property views and other stuff coming from given Eclipse plugins - and all of them are using my system's language (which is German). My UI now looks totally awkward with mixed languages that I simply don't want.
So, my question is not how to properly internationalize an application, but rather NOT to have it display anything but English, no matter what the system is it's running on.
Should be, easy, shouldn't it?
I tried setting default locale with this:
Locale.setDefault(Locale.ENGLISH);
in the Application class start method, but that does not help at all. Why? Where does it get the language from?
Thanks for your help!
you can look at following runtime options to configure eclipse platform.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
osgi.nl is an option to run platform with desired locale.
Go to your .product file in the launching tab. In the 'launching arguments' part put in the 'All platforms tab' :
-nl en
Don't forget to export the product before testing. If you want to launch your app using Eclipse, put the previous line to your 'Run configuration' in the 'Arguments' tab
Related
In my swing application, I have set the UI Look and Feel as:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
And it works well on Windows. Inside, the application, the user has to select files using the JFileChooser. The JFileChooser appearance on windows is again the native one. But not on Mac.
The screenshot of the JFileChooser Panel:
But instead, I prefer something like this: (This one is taken from upload option in gmail)
What should I change the UIManager to or anything else??
Several alternatives include these:
java.awt.FileDialog, illustrated here.
A custom ChooserUI, shown here.
A completely custom implementation; several variations are shown here.
On MacOS, you can use the FileDialog which looks like what you are describing. The drawback is that it is a lot less configurable.
I have experienced a lot of troubles when migrating from Java 6 to Java 8 since with my Java application I have to open some proprietary file bundles.
FileDialog still gives the better LookAndFeel, but treats the bundled files as if it were directories. A first fix to this is to set FileDialog to select directories, which still allows to navigate inside the file-bundle, but as well allows to select the bundle as a whole.
System.setProperty("apple.awt.fileDialogForDirectories", "true");
Not quite happy by the solution I tried other options, including the VAqua LookAndFeel for macOS which looked really great but sometimes didn't display me all the UI Elements (some JTree were hidden at startup, and JFileChooser did look great, but still didn't show me the Network drives in the sidebar).
Finally I found a simple property that - when set - allows to use FileDialog as it was under Java 6. Of course, if we want to select files and not directories, the line above must be deleted.
System.setProperty("apple.awt.use-file-dialog-packages", "true");
Found this one in an old example project about Dialog personalization
The file chooser implementation for Windows, Linux and Mac is not 100% right for any OS
Unfortunately if you really want this you need to look for a replacement for JFileChooser or you need to write your own look and fee.
Java has trouble keeping up with the OS changes.
I created a new project using the play console
now, by default I got in my views directory two files:
main.scala.html
index.scala.html
I want to add a new view file. I call it "forums.scala.html"
now, I know that in order to render a view you need to do this:
views.html.forums.render("Forums");
the problem is that the intellisense doesn't recognize "forums"
but index and main it does recognize.
I've noticed those files:
class_managed/views.html/index.class
class_managed/views.html/main.class
but there is no forums.class so I suspect this is the problem.
I tried to build the project, but it didn't help.
so, what is the solution?
thanks
Your new views are compiled to managed sources after next browser hit if you are using play run for starting Play in dev mode.
If you'll use play ~run it will try to compile it as soon at it will recognize change in the file.
Finally if you started your app in production mode ie. via play start you have to stop it with ctrl+c and run again. Anyway, developing application in production mode is just a bad idea :)
Depending on your IDE most probably you'll need to refresh file structure to allow it find freshly created managed sources.
right click on ther project and click refresh, that worked for me - found it in another thread.
Found the solution.
running "compile" command did the work.
I understood that intelliJ do it auto, so I will probably use it instead of eclipse.
cheers!
If you want to program in scala, my recommendation is to forget about intellisense. Eclipses scala-ide is quite buggy, dont know about netbeans. And because of nonstandard layout of play2 application, non std development tools (play console), it becames even more handy to use simple text redactor (like sublime or textmate) with good old open-folder-as-project feature.
I've been trying to figure out for a while now how to call an Eclipse menu item from within a plug-in that I'm developing. Say, for the sake of this posting, I want to call the eclipse "Format" menu item in the Right Click Menu to format a source, how would I go about doing this by calling that item (i.e. not just mimicking that menu item's effect, actually calling it)?
I'm not looking for how to format code, just simply the idea of calling a menu item.
I was leaning towards the APIs info on IWorkbench, Shell, ToolBar, ToolItem, etc., but I don't really know. I haven't been able to find anything on this topic in the APIs or anywhere else online. Is there a better approach to doing this rather than programmatically?
Eclipse JDT - http://help.eclipse.org/indigo/index.jsp?nav=%2F3
EDIT:
String commandId = "org.eclipse.jdt.ui.edit.text.java.format";
IHandlerService handlerService = (IHandlerService)(IHandlerService ) PlatformUI.getWorkbench().getService(IHandlerService.class);
handlerService.executeCommand(commandId, null);
Simple as that. The hardest part is finding the commandId, which can be easily searched for, as rlegendi mentioned. This is exactly what I wanted. It accesses that plugin via ID, then executes it. Simple and effective. Thanks everyone!
I'm not sure but probably what you want to read about is the Command/Delegate framework.
BTW if you install the Eclipse Platform SDK plugin (available by default), you can actually take a look on the source code of any plugin that is the part of your current Eclipse product (try Ctrl+Shift+T and typing ISourceViewer for instance, there you find the FORMAT it, for which you can do a search with Ctrl+Shift+G), and you can import any of those plugin projects to your own workspace to examine.
I've developed a small app for someone.
I'm on windows, he's on a Mac.
He now tells me that in the "about" section he can see the package name I used.
I do not know how to access this menu on windows, he tells me it's right next to the apple button.
I used a nondescript name for the package, and he thinks it's ugly.
So...where would I find the settings for that in Eclipse?
I'll edit the question if it's too unclear...
But right now it shows something like com.foo.bar.etc
Stuff like that.
This is the default behaviour when you create a Java application and run it on MacOS. Give Macify a look - it allows you to integrate your Java app nicely with macos without breaking platform compatibility.
I want to create an eclipse RCP application for a custom language. A programs which is written using the cutom language should be run and show it's output when the user click on the Run button.
Is it possible to integrate eclipse Run menu in eclipse RCP application with it's default features as we create NEW menu item by using ActionFactory? If it is possible how to do that?
Thanks in advance.
If you "just" want the Run menu along with the default entries, just include a dependency to org.eclipse.debug.ui.
You will then need to add launch configuration types for your specific language using the various extension point from the plugins org.eclipse.debug.core and org.eclipse.debug.ui.
As always, when it comes to the more advanced functionality of Eclipse, the easiest way to get access to the functionality is via resources and examples. Although it is a bit dated, the article "We Have Lift-off" (http://www.eclipse.org/articles/Article-Launch-Framework/launch.html) is the best starting point for this. Have a look at the various references to org.eclipse.debug.core.launchConfigurationTypes to find the best example to use asa starting point - in particular the ANT Build stuff as this is pretty simple...
In general you can find the plug-in that contributes a specific entry using the PDE Menu Spy (Alt-Shift-F2 on MacOS)...