Skip to main content

Eclipse

Prerequisites

Installing Eclipse

Download and install Eclipse for RCP and RAP developers.

Setting up Eclipse

Adding an execution platform

The Eclipse execution platform must be completed with BlueMind dependencies:

  1. start and initialize a workspace using the version of Eclipse you want to develop with (e.g. Eclipse Mars, previously installed)
  2. go to Window->Preferences, search for Target
  3. click Target Platform
  4. click Add, choose Nothing, click Next
  5. type a name (e.g.: BlueMind 3.5)
  6. click Add, choose Software Site, then click Next
  7. in the "Work with" box, type http://forge.blue-mind.net/staging/p2/bluemind/latest
    1. at the bottom of the window uncheck "Group by category" and "Include required software"
    2. in the updated list, check Feature
  8. click Finish
  9. click Add again, choose Software Site, then click Next
  10. in the "Work with" box, type http://forge.blue-mind.net/staging/p2/dependencies/current/
    1. at the bottom of the window, uncheck "Group by category" and "Include required software"
    2. in the updated list, check bm-eclipse-platform
  11. click Finish
  12. click Finish again
  13. make sure that the new platform is selected and click Apply then OK to quit

Configuration

Formatting

To use uniform code formatting in Eclipse:

  1. go to Window, then Preference
  2. search for Save Actions, click Java->Editor->Save Actions
  3. check Perform the selected actions on save
  4. check Format source code, and select Format all lines
  5. check Organize imports
  6. click Apply, then OK

Headers

It is important that source file headers are compliant. In Eclipse:

  1. go to Window, then Preference
  2. search for Template, click Java->Code Style->Code Template
  3. open the Code menu and click New Java files
  4. click Edit
  5. in the Pattern section, add:

New Java file pattern

/\* BEGIN LICENSE
\* Copyright © Blue Mind SAS, 2012-${year}
\*
\* This file is part of BlueMind. BlueMind is a messaging and collaborative
\* solution.
\*
\* This program is free software; you can redistribute it and/or modify
\* it under the terms of either the GNU Affero General Public License as
\* published by the Free Software Foundation (version 3 of the License).
\*
\* This program is distributed in the hope that it will be useful,
\* but WITHOUT ANY WARRANTY; without even the implied warranty of
\* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\*
\* See LICENSE.txt
\* END LICENSE
\*/
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}
  1. click OK
  2. click Apply, then OK

Initializing the Eclipse workspace

"Package explorer"

Before you import the plugins, you must make sure that you are using the "Package explorer" view to browse plugins (for performance reasons).

To open it:

  1. Go to Window / Show View
  2. If it doesn't appear here, click "Other" and you will find it in the "Java" category
  3. Close other plugin list views such as "Project Explorer" or "Plugins..."

Importing plugins

In Eclipse

  1. go to File, Import menu
  2. open General, select Existing projects into Workspace
  3. click Next
  4. check Select root directory, click Browse
  5. select the open folder in the BlueMind Git, and click OK
  6. if there is only one project in the Projects list, clean up the Git. Go to the BlueMind Git root directory and run: git clean -f -d -n -x, then start again from step 1
  7. otherwise, click Finish
  8. repeat this operation for the closed BlueMind Git directory

Adding a Maven build

You must add a Maven build:

  1. in a terminal, go to the open BlueMind Git directory
  2. run the command: mvn -Dmaven.test.skip=true clean install
  3. do the same in the directory open/ui/gwt-libs/
  4. in Eclipse, select all the packages and press F5 (Refresh)