Archive for the ‘Eclipse’ Category

Eclipse e4 New look and feel – A round the tab world

Wednesday, March 10th, 2010

Eclipse e4 M4 has introduce a new look and feel for the tabs in the workbench. See Eclipse e4 M4 New and Noteworthy. Unfortunately the news and noteworthy document did not give information how to enable this feature.

The e4 mailing list has recently discussed this topic and Remy Suen was kind enough to provide this information. To turn this feature on you have to add the tag “newtablook” to your PartStack.

For example if you create an new e4 application with the e4 wizard you can add this tag via:


<children xsi:type="application:PartSashContainer" xmi:id="_vTa8kiuFEd-PeMLywHTM-g" id="_vTa8kiuFEd-PeMLywHTM-g">
  <children xsi:type="application:PartStack" xmi:id="_vTa8kyuFEd-PeMLywHTM-g" id="_vTa8kyuFEd-PeMLywHTM-g">
     <tags>newtablook</tags>
   <children xsi:type="application:Part" xmi:id="_vTa8lCuFEd-PeMLywHTM-g" id="_vTa8lCuFEd-PeMLywHTM-g" label="Main"/>
</children>

This lead to the following result:

Compared to the “old” look and feel.

For this topic see also Bug 305147 which discusses to move this feature to the CSS styling capabilities.

 

10 golden rules of asking questions in the OpenSource community

Tuesday, March 9th, 2010

Based on my tutorial website I frequently receive questions from users. Some are very nice, precise, encouraging and some are of perceived bad quality. I also ask lot of questions in the Eclipse community and I try to ask good questions. Of course I frequently fail to ask good questions ;-) but at least I try.

So what makes a question, a good or even an excellent question?

I personally believe the following rules are a good guideline:

10 Golden Rules

  1. Don’t be rude
  2. Try to be as precise and as short as possible
  3. Do your homework before asking (Google, search newgroups, read tutorials,…)
  4. Try to ask one question at the time
  5. Proof-read your question after writing it
  6. Don’t expect others to do your work
  7. Avoid private email if other channels exists
  8. Remind yourself that people help you voluntarily
  9. Read and follow up on suggestions
  10. If you get a solution let others know

What do you think? Did I miss an important point?

For a detailed discussion of how to ask good questions see How to ask smart questions.

 

Knights of the round table – Eclipse committer election

Friday, February 19th, 2010

Eclipse Committer Election is starting as of 22. Febr. This is the first year I’m allowed to vote therefore I’m thinking what should guide my vote.

I recently read the book The Art of Community from Jono Bacon.

Jone speaks about the concept of Meritocracy.

A meritocracy is a system of governance in which its members are given responsibilities and recognition based upon achievements, merit, and talent. Those who are part of a meritocracy (such as in the Ubuntu and other open source communities) can make tremendous advances in respect and responsibility by simply doing good work. In these communities, money, class, and family connections have little or no impact on the ability to progress and build a reputation.

I believe that is an excellent concept and my vote will be guided by this principle. For an excellent summary of the committer project activities please see the How active is your-Committer blog entry from Ed Merks.

In addition to the involvement of the candidates in Eclipse projects I will also consider their community activity and attitude in the other Eclipse channels, e.g. their twitter activity, blog posts, email, etc.

I’m looking forward to the election; I think we have lots of great candidates.

 

Debugging Eclipse e4

Thursday, February 18th, 2010

Eclipse e4 has sometimes the tendency to do thing differently then expected. For example the modeled workbench may not show certain UI elements. In this case it is difficult to find out what is wrong.

This blog post tries to help to look inside the initialization process of an Eclipse e4 application.

In my e4 tutorial I write that you always have to start the application “org.eclipse.e4.ui.workbench.swt.E4Application”.

The implementation class is “org.eclipse.e4.ui.workbench.swt.internal.E4Application” and can be found in the plugin “org.eclipse.e4.ui.workbench” in. This instance of IApplication is created by the framework.

In this class you find the main entry point to your application:

public Object start(IApplicationContext applicationContext)
			throws Exception {

			}

The following line creates the mighty IEclipseContext.


IEclipseContext appContext = createDefaultContext();

In createDefaultContext() you find for example that e4 sets initially an empty Styling engine and you find the registration of the extension registry.

The next line is more interesting, its load the models. Here you can check if the model entries are available as expected.


MApplication appModel = loadApplicationModel(applicationContext,
				appContext);

Just in case you are wondering “M” Elements refer to the UI workbench model modeled with EMF. MApplication is the model element for the application and extends for example MContent which allows to store the IEclipseContext.

After a few lines of compatibility stuff the the model is added to the IEclipseContext and vise versa:

// Set the app's context after adding itself
		appContext.set(MApplication.class.getName(), appModel);
		appModel.setContext(appContext);

The next lines are interesting as they also reveal typical errors (I make). They load the parameters for “applicationXMI”, css stylesheets and the rendering engine. Here you can check if you parameters are read by the engine.

		// Parse out parameters from both the command line and/or the product
		// definition (if any) and put them in the context
		String xmiURI = getArgValue(E4Workbench.XMI_URI_ARG, applicationContext);
		appContext.set(E4Workbench.XMI_URI_ARG, xmiURI);
		String cssURI = getArgValue(E4Workbench.CSS_URI_ARG, applicationContext);
		appContext.set(E4Workbench.CSS_URI_ARG, cssURI);
		String cssResourcesURI = getArgValue(E4Workbench.CSS_RESOURCE_URI_ARG,
				applicationContext);
		appContext.set(E4Workbench.CSS_RESOURCE_URI_ARG, cssResourcesURI);

		// This is a default arg, if missing we use the default rendering engine
		String presentationURI = getArgValue(E4Workbench.PRESENTATION_URI_ARG,
				applicationContext);
		if (presentationURI == null) {
			presentationURI = PartRenderingEngine.engineURI;
			appContext.set(E4Workbench.PRESENTATION_URI_ARG, presentationURI);
		}

The last lines are for actually creating the E4Workbench and running it.

/ Instantiate the Workbench (which is responsible for
// 'running' the UI (if any)...
E4Workbench workbench = new E4Workbench(appModel, appContext);

The class “org.eclipse.e4.workbench.ui.internal.E4Workbench” is worth a look. It defines the fixed values for the possible parameters, e.g. “applicationXMI”.

The init() method is responsible for creating the UI in the method call Workbench.processHierarchy(appElement); where appElement is initially the MApplication. processHierachy() is then recursively called for all model elemements.

I hope this helps in evaluating and debugging the e4 platform. Let me know what you think.

 

Apache Tomcat 6.0 Server Unable to Start

Tuesday, February 16th, 2010

I occasionally have problems with starting Tomcat from Eclipse. Eclipse WTP gives me the message:

Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

While searching the web I found that others also have the problem hence this blog post.

Via a Eclipse forums post I recently learned how I could analyse the the problem.

Larry Isaacs explains:

The lack of output in the Console view suggests that the attempt to launch Tomcat is failing. After attempting to start Tomcat, switch to the Debug perspective and look in the Debug window. You should see a terminated launch. You can right-click on the nested item under the terminated launch and select Properties. This should display the command line that is being used to launch Tomcat. You could try that command in a terminal window to see what happens.

Eclipse uses javaw so you have to change it to java, as javaw will not open a console or log anything to an existing console (as Larry also explains in the forum post).

I hope this helps to identify the problem. I personally restarted my Laptop and ran Eclipse with -clean and now Tomcat starts again without problems.

 

Checking out EGit source code with EGit

Friday, February 12th, 2010

Git and EGit are getting popular. In case you want to start hacking on EGit this will give you some hints.

First install EGit following this guide EGit Tutorial.

First you need a few libraries from Orbit via cvs. The cvs location is “:pserver:anonymous@dev.eclipse.org/cvsroot/tools”. You need:

  • org.eclipse.orbit/com.jcraft.jsch
  • org.eclipse.orbit/org.kohsuke.args4j
  • org.eclipse.orbit/javax.servlet

See Libraries from Orbit for getting these libraries.

Select File -> Import -> Git -> Git Repository and paste the URL “git://egit.eclipse.org/jgit.git” into the first line.

Do the same with “git://egit.eclipse.org/egit.git”.

Currently there is a little bug in EGit, please see Bug Report. If you facing the problem that the Team operations are not available on your new project my EGit Tutorial describes what to do to make the Team operations available. This should be fixed very soon, path is already commited to the master branch.

You have now the source code in your workspace and can start hacking.

For more info please see the excellent EGit Contributor Guide.

 

Save a second in every Eclipse bug report ;-)

Thursday, January 21st, 2010

Eclipse Bugzilla ask you for your Eclipse Build ID. As I learned from Paul Webster in Bug 300260 you can use the following to put this build ID into the clipboard:

CTRL+3 cbi (Copy Build Id)

Seems like Eclipse has a command for everything. :-)

 

Google the location of a plugin in Eclipse cvs

Tuesday, January 19th, 2010

If you want to find the cvs location of a certain Eclipse plugin you can use Google site search using site:”dev.eclipse.org/viewsvn”.

For example if you are looking for the cvs location of the plugin “org.eclipse.e4.tools.ui” you can run the following Google search:

“org.eclipse.e4.tools.ui” site:dev.eclipse.org/viewsvn

Thanks to Tom Seidel for sharing this tip via twitter.

 

Eclipse e4 tutorial – Update

Saturday, January 16th, 2010

I had several l requests to update Create your first Eclipse e4 application to the latest changes.

I have written an updated version of this description Eclipse e4 tutorial. It should be compliant with the Eclipse e4 Milestone 3.

Like the blog entry this is currently only creating a very simple example. I’m planning to extend this tutorial over time to demonstrate the advantages of dependency injection, css styling, different renderes, etc.

Hope this helps getting started with Eclipse e4.

Let me know what you think about e4 and what e4 functionality should be also be the tutorial.

 

TreetableViewer Example

Wednesday, January 13th, 2010

In regards to my JFace Table Tutorial I got the question how to create a TreeTableViewer in the vogella Google Group .

Friedmut Hill was kind enough to point to the following Wiki entry with TreeTableViewer example which gives a very nice and concise example.

Thanks to Friedmut for sharing this information!