Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Swing PlannerField
Swing PlannerField [message #1456333] Thu, 30 October 2014 08:48 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi,

There is a plannerField (Swing only). Does anyone has an example how to get this up and running?

Regards Bertin
Re: Swing PlannerField [message #1456452 is a reply to message #1456333] Thu, 30 October 2014 11:27 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
The wiki page is a start, but we need to provide some more explanations.

https://wiki.eclipse.org/Scout/Concepts/PlannerField

.
Re: Swing PlannerField [message #1471625 is a reply to message #1456452] Thu, 13 November 2014 08:14 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Let start with a personal opinion about the planner field: it was developed for some custom needs of a commercial product at BSI. The API is not really intuitive and wasn't updated (still array based ...). There is no SDK support. It is only available in the Swing UI. Maybe it should have stayed as a custom-field of this commercial application and not land into the eclipse scout framework.

If you think it can suit your need (which are really specific), here some inputs to start to use the field.

Example:
index.php/fa/19879/0/

The Grid displays a set of ActivityCells. Each ActivityCell contains:
* resourceId (Generic Type: RI)
* activityId (Generic Type: AI)
* startTime (Date)
* endTime (Date)
* text (String)
* tooltipText (String)
* iconId (String)
* majorValue (float)
* minorValue (float)

Resources are listed in the Table: ResourceTable an inner-class of the planner field.
* This Table contains a column (primary key, same type of RI) to store the resourceId.
* And additional columns (Name and Detail in this case).

To populate the table, add some logic in YourPlannerField.execLoadResourceTableData(). Return an array Object[][] that will some data for the RessourceTable.

To populate initial data in the field, add some logic in the method: YourPlannerField.execLoadActivityMapData(..) The method should return a bi dimensional array: Object[][]: first dimension is the quantity of ActivityCells you want to display. Second dimension is 9: it corresponds to the properties of the ActivityCell (resourceId, activityId, startTime, endTime, text, tooltipText, iconId, majorValue, minorValue)

To initialize the field, you need to compute an array of the days you want to be displayed (if you chose to display a calendar getConfiguredMiniCalendarCount() > 0. The user will be able to change the selected days).
 Date d = DateUtility.parse("2014-11-01", "yyyy-MM-dd");
Date[] days = new Date[30];
for (int i = 0; i < days.length; i++) {
  days[i] = DateUtility.addDays(d, i);
}
getActivityMap().setDays(days);

This code can be set in execInitField(). In this method, you can set the PlanningMode. You should also call: loadResourceTableData();

Menus:
There are two types of menus that you can put in the activity map.

ActivityMapMenuType.Activity
This type of menu is displayed when an ActivityCell is selected (Delete menu in this example):
index.php/fa/19880/0/
You can access the selected activity cell with getSelectedActivityCell()

ActivityMapMenuType.Selection
This type of menu is displayed when a selection is made in the grid (Create menu in this example)
index.php/fa/19881/0/
You can access the selection with the methods: getSelectedResourceIds(), getSelectedBeginTime(), getSelectedEndTime()

The code I have used for this example is hosted in this Gist.

I hope it help you to start. Do not hesitate to continue the discussion... (There are more features - I do not know what you need).
Re: Swing PlannerField [message #1471645 is a reply to message #1471625] Thu, 13 November 2014 08:31 Go to previous message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
Hi Jeremie,

this is a perfect example, thanks.
Previous Topic:Question about Activator template in SDK
Next Topic:Time field
Goto Forum:
  


Current Time: Thu Apr 25 13:42:17 GMT 2024

Powered by FUDForum. Page generated in 0.02926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top