[Escapek-commits] SF.net SVN: escapek: [814]
Status: Pre-Alpha
Brought to you by:
nicolasjouanin
|
From: <nic...@us...> - 2007-02-15 20:44:52
|
Revision: 814
http://svn.sourceforge.net/escapek/?rev=814&view=rev
Author: nicolasjouanin
Date: 2007-02-15 12:44:49 -0800 (Thu, 15 Feb 2007)
Log Message:
-----------
Code cleanup.
Make code 3.3M5 API compatible
Modified Paths:
--------------
org.escapek.client/trunk/src/org/escapek/client/Application.java
org.escapek.client/trunk/src/org/escapek/client/repository/RepositoryCreator.java
org.escapek.client.cmdb.en/trunk/META-INF/MANIFEST.MF
org.escapek.client.core/trunk/META-INF/MANIFEST.MF
org.escapek.client.core/trunk/src/org/escapek/client/core/ui/databinding/DataBindingContextFactory.java
org.escapek.client.tools/trunk/META-INF/MANIFEST.MF
org.escapek.client.ui/trunk/src/org/escapek/client/ui/tools/FormTools.java
org.escapek.client.ui.cmdb/trunk/src/org/escapek/client/ui/cmdb/providers/ContactContentProvider.java
org.escapek.client.ui.cmdb.en/trunk/META-INF/MANIFEST.MF
org.escapek.client.ui.cmdb.en/trunk/build.properties
org.escapek.client.ui.en/trunk/META-INF/MANIFEST.MF
org.escapek.client.ui.en/trunk/build.properties
org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/RoleMainFormPage.java
org.escapek.i18n/trunk/META-INF/MANIFEST.MF
org.escapek.i18n.en/trunk/META-INF/MANIFEST.MF
org.escapek.i18n.fr/trunk/META-INF/MANIFEST.MF
org.escapek.logger/trunk/META-INF/MANIFEST.MF
org.escapek.preferences/trunk/META-INF/MANIFEST.MF
Added Paths:
-----------
org.escapek.client.cmdb/trunk/plugin.properties
org.escapek.client.ui/trunk/plugin.properties
org.escapek.client.ui.cmdb/trunk/plugin.properties
org.escapek.client.ui.security/trunk/plugin.properties
org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/providers/ObservableUserLabelProvider.java
Removed Paths:
-------------
org.escapek.client.cmdb.en/trunk/plugin_en.properties
org.escapek.client.ui.cmdb.en/trunk/plugin_en.properties
org.escapek.client.ui.en/trunk/plugin_en.properties
org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/providers/RoleGrantedUserLabelProvider.java
org.escapek.client.ui.security.en/trunk/plugin_en.properties
Modified: org.escapek.client/trunk/src/org/escapek/client/Application.java
===================================================================
--- org.escapek.client/trunk/src/org/escapek/client/Application.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client/trunk/src/org/escapek/client/Application.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,27 +1,48 @@
package org.escapek.client;
-import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
/**
* This class controls all aspects of the application's execution
*/
-public class Application implements IPlatformRunnable {
+public class Application implements IApplication
+{
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
- */
- public Object run(Object args) throws Exception {
+ public Object start(IApplicationContext context) throws Exception
+ {
Display display = PlatformUI.createDisplay();
- try {
+ try
+ {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
- if (returnCode == PlatformUI.RETURN_RESTART) {
- return IPlatformRunnable.EXIT_RESTART;
+ if (returnCode == PlatformUI.RETURN_RESTART)
+ {
+ return IApplication.EXIT_RESTART;
}
- return IPlatformRunnable.EXIT_OK;
- } finally {
+ return IApplication.EXIT_OK;
+ }
+ finally
+ {
display.dispose();
}
}
+
+ public void stop()
+ {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench == null)
+ return;
+ final Display display = workbench.getDisplay();
+ display.syncExec(new Runnable()
+ {
+ public void run()
+ {
+ if (!display.isDisposed())
+ workbench.close();
+ }
+ });
+ }
}
Modified: org.escapek.client/trunk/src/org/escapek/client/repository/RepositoryCreator.java
===================================================================
--- org.escapek.client/trunk/src/org/escapek/client/repository/RepositoryCreator.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client/trunk/src/org/escapek/client/repository/RepositoryCreator.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -33,8 +33,8 @@
import java.util.Hashtable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -102,7 +102,7 @@
public void done(IJobChangeEvent event)
{
if(!event.getResult().isOK())
- Platform.getJobManager().cancel(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION);
+ Job.getJobManager().cancel(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION);
}
});
}
@@ -133,11 +133,11 @@
creationJobs[i].setProgressGroup(monitor, 1);
creationJobs[i].schedule();
}
- Platform.getJobManager().join(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION, monitor);
+ Job.getJobManager().join(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION, monitor);
}
catch (InterruptedException e)
{
- Platform.getJobManager().cancel(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION);
+ Job.getJobManager().cancel(EscapeKJob.JOB_FAMILY_REPOSITORY_CREATION);
}
finally
{
Added: org.escapek.client.cmdb/trunk/plugin.properties
===================================================================
--- org.escapek.client.cmdb/trunk/plugin.properties (rev 0)
+++ org.escapek.client.cmdb/trunk/plugin.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -0,0 +1,123 @@
+#Properties
+AddressProperty.displayName=Address
+AddressProperty.description=Type used to stores physical addresses like street name, building, ...
+BooleanProperty.displayName=Boolean
+BooleanProperty.description=Used to store on/off , true/false values.
+IntegerProperty.displayName=Integer
+IntegerProperty.description=Integer value
+RegistryNodeProperty.displayName=Registry node
+RegistryNodeProperty.description=Registry node value
+DoubleProperty.displayName=Double
+DoubleProperty.description=Double decimal value
+StringProperty.displayName=String
+StringProperty.description=String value
+DateProperty.displayName=Date
+DateProperty.description=Date value
+
+#Relation Types
+InclusionRelationType.displayName=Inclusion
+InclusionRelationType.description=A relation type where a CI includes another
+
+#Relation classes
+ContainedLocation.displayName=Contained location
+ContainedLocation.description=Locations included into another
+
+#CI classes
+ConcreteJob.displayName=Concrete Job
+ConcreteJob.description=A concrete version of Job. This class represents a generic and instantiable unit of work, such as a batch or a print job.
+ConcreteJob.TimeOfLastStateChange.displayName=Time of last state change
+ConcreteJob.TimeOfLastStateChange.description=The date or time when the state of the Job last changed.
+ConcreteJob.JobState.displayName=Job state
+%ConcreteJob.JobState.description=JobState is an integer enumeration that indicates the operational state of a Job. It can also indicate transitions between these states, for example, 'Shutting Down' and 'Starting'.
+EnabledLogicalElement.displayName=Enabled logical element
+EnabledLogicalElement.description=This class extends LogicalElement to abstract the concept of an element that is enabled and disabled, such as a LogicalDevice or a ServiceAccessPoint.
+EnabledLogicalElement.TimeOfLastStateChange.displayName=Time of last state change
+EnabledLogicalElement.TimeOfLastStateChange.displayName=The date or time when the EnabledState of the element last changed.
+EnabledLogicalElement.OtherEnabledState.displayName=Other enabled state
+EnabledLogicalElement.OtherEnabledState.displayName A string that describes the enabled or disabled state of the element when the EnabledState property is set to 'Other'.
+EnabledLogicalelement.EnabledState.displayName=Enabled state
+EnabledLogicalelement.EnabledState.displayName=EnabledState indicates the enabled and disabled states of an element. It can also indicate the transitions between these requested states. For example, 'shutting down' 'starting' are transient states between enabled and disabled.
+EnabledLogicalElement.RequestedState.displayName=Requested state
+EnabledLogicalElement.RequestedState.description=RequestedState that indicates the last requested or desired state for the element. The actual state of the element is represented by EnabledState. This property is provided to compare the last requested and current enabled or disabled states. Note that when EnabledState is set to 5 'Not Applicable', then this property has no meaning. By default, the RequestedState of the element is 'No Change'. Refer to the EnabledState property description for explanations of the values in the RequestedState enumeration.
+Job.displayName=Job
+Job.description=A Job is a LogicalElement that represents an executing unit of work, such as a script or a print job. A Job is distinct from a Process in that a Job can be scheduled or queued, and its execution is not limited to a single system.
+Job.UntilTime.displayName=Until time
+Job.UntilTime.description= The time after which the Job is invalid or should be stopped.
+Job.RunDay.displayName=Run day
+Job.RunDay.description=The day in the month on which the Job should be processed. There are two different interpretations for this property, depending on the value of DayOfWeek. In one case, RunDay defines the day-in-month on which the Job is processed. This interpretation is used when the DayOfWeek is 0. A positive or negative integer indicates whether the RunDay should be calculated from the beginning or end of the month. For example, 5 indicates the fifth day in the RunMonth and -1 indicates the last day in the RunMonth.\nWhen RunDayOfWeek is not 0, RunDay is the day-in-month on which the Job is processed, defined in conjunction with RunDayOfWeek. For example, if RunDay is 15 and RunDayOfWeek is Saturday, then the Job is processed on the first Saturday on or after the 15th day in the RunMonth (for example, the third Saturday in the month). If RunDay is 20 and RunDayOfWeek is -Saturday, then this indicates the first Saturday on or before the 20th day in the RunMonth. If RunDay is -1 and RunDayOfWeek is -Sunday, then this indicates the last Sunday in the RunMonth.
+Job.JobStatus.displayName=Job status
+Job.JobStatus.description= A free-form string that represents the status of the job. The primary status is reflected in the inherited OperationalStatus property. JobStatus provides additional, implementation-specific details.
+Job.DeleteOnCompletion.displayName=Delete on completion
+Job.DeleteOnCompletion.description=Indicates whether or not the job should be automatically deleted upon completion. Note that the 'completion' of a recurring job is defined by its JobRunTimes or UntilTime properties, or when the Job is terminated by manual intervention. If this property is set to false and the job completes, then the extrinsic method DeleteInstance must be used to delete the job instead of updating this property.
+Job.RunStartInterval.displayName=Run start interval
+Job.RunStartInterval.description=The time interval after midnight when the Job should be processed.
+Job.ErrorDescription.displayName=Error description
+Job.ErrorDescription.description=A free-form string that contains the vendor error description.
+Job.ErrorCode.displayName=Error code
+Job.ErrorCode.description= A vendor-specific error code. The value must be set to zero if the Job completed without error.
+Job.TimeSubmitted.displayName=Time submitted
+Job.TimeSubmitted.description=The time that the Job was submitted to execute.
+Job.OtherRecoveryAction.displayName=Other recovery action
+Job.OtherRecoveryAction.description=A string describing the recovery action when the RecoveryAction property of the instance is 'Other'.
+Job.RunMonth.displayName=Run month
+Job.RunMonth.description=The month during which the Job should be processed.
+Job.RunDayOfWeek.displayName=Run day of week
+Job.RunDayOfWeek.description=A positive or negative integer used in conjunction with RunDay to indicate the day of the week on which the Job is processed. RunDayOfWeek is set to 0 to indicate an exact day of the month, such as March 1. A positive integer (representing Sunday, Monday, ..., Saturday) means that the day of week is found on or after the specified RunDay. A negative integer (representing -Sunday, -Monday, ..., -Saturday) means that the day of week is found on or BEFORE the RunDay.
+Job.JobRunTimes.displayName=Job run times
+Job.JobRunTimes.description= The number of times that the Job should be run. A value of 1 indicates that the Job is not recurring, while any non-zero value indicates a limit to the number of times that the Job will recur. Zero indicates that there is no limit to the number of times that the Job can be processed, but that it is terminated either after the UntilTime or by manual intervention.
+Job.ElapsedTime.displayName=Elapsed time
+Job.ElapsedTime.description= The time interval that the Job has been executing or the total execution time if the Job is complete.
+Job.StartTime.displayName=Start time
+Job.StartTime.description= The time that the Job was actually started.
+Job.RecoveryAction.displayName=Recovery action
+Job.RecoveryAction.description=Describes the recovery action to be taken for an unsuccessfully run Job.
+Job.LocalOrUtcTime.displayName=Local or UTC time
+Job.LocalOrUtcTime.description=This property indicates whether the times represented in the RunStartInterval and UntilTime properties represent local times or UTC times. Time values are synchronized worldwide by using the enumeration value 2, 'UTC Time'.
+Job.PercentComplete.displayName=Percent complete
+Job.PercentComplete.description=The percentage of the job that has completed at the time that this value is requested.
+Job.Priority.displayName=Priority
+Job.Priority.description=Indicates the urgency or importance of execution of the Job. The lower the number, the higher the priority.
+Location.displayName=Location
+Location.description=The Location class specifies the position and address of a PhysicalElement.
+Location.physicalLocation.displayName=Physical location
+Location.physicalLocation.description= Position is a free-form string that indicates the placement of a PhysicalElement. It can specify slot information on a HostingBoard, mounting site in a Cabinet, or latitude and longitude information, for example, from a GPS. It is part of the key of the Location object.
+Location.address.displayName=Address
+Location.address.description= Address indicates a street, building, or other type of address for the location of the PhysicalElement.
+LogicalElement.description=Logical element
+LogicalElement.description=LogicalElement is a base class for all the components of a System that represent abstract system components, such as Files, Processes, or LogicalDevices.
+ManagedSystemElement.displayName=Managed System element
+ManagedSystemElement.description=ManagedSystem is the base class for the System Element hierarchy. Any distinguishable component of a System is a candidate for inclusion in this class. Examples of system components include:\n- software components such as application servers, databases, and applications\n- operating system components such as files, processes, and threads\n- device components such as disk drives, controllers, processors, and printers\n- physical components such as chips and cards.
+ManagedSystemElement.installDate.displayName=Installation date
+ManagedSystemElement.installDate.description=Date indicating when the object was installed.
+ManagedSystemElement.statusDescription.diplayName=Status description
+ManagedSystemElement.statusDescription.description=String describing the the operational status.
+ManagedSystemElement.healthState.displayName=Health state
+ManagedSystemElement.healthState.description=Indicates the current health of the element. This attribute expresses the health of this element but not necessarily that of its subcomponents.
+ManagedSystemElement.operationalStatus.displayName=Operational status
+ManagedSystemElement.operationalStatus.description=Operational status of the element.
+PhysicalElement.displayName=Physical element
+PhysicalElement.description=Physical element define any component of a System that has a distinct physical identity. Instances of this class can be defined as an object that can be seen or touched. All Processes, Files, and LogicalDevices are considered not to be Physical Elements. For example, it is not possible to touch the functionality of a 'modem.' You can touch only the card or package that implements the modem. The same card could also implement a LAN adapter. PhysicalElements are tangible ManagedSystemElements that have a physical manifestation of some sort.
+PhysicalElement.vendorEquipmentType.displayName=Vendor equipement type
+PhysicalElement.vendorEquipmentType.description=Vendor-specific hardware type for the PhysicalElement. It describes the specific equipment type for the element, as defined by the vendor or manufacturer.
+PhysicalElement.model.displayName=Model
+PhysicalElement.model.description=The name by which the PhysicalElement is generally known.
+PhysicalElement.partNumber.displayName=Part number
+PhysicalElement.partNumber.description=The part number assigned by the organization that is responsible for producing or manufacturing the PhysicalElement.
+PhysicalElement.poweredOn.displayName=Powered on
+PhysicalElement.poweredOn.description=Boolean that indicates whether the PhysicalElement is powered on or is currently off.
+PhysicalElement.otherIdentifyingInfo.displayName=Other identifying information
+PhysicalElement.otherIdentifyingInfo.description=This information could be used to identify a Physical Element. One example is bar code data associated with an Element that also has an asset tag.
+PhysicalElement.serialNumber.displayName=Serial number
+PhysicalElement.serialNumber.description=A manufacturer-allocated number used to identify the Physical Element.
+PhysicalElement.userTracking.displayName=User tracking
+PhysicalElement.userTracking.description=User-assigned and writeable asset-tracking identifier for the PhysicalElement.
+PhysicalElement.manufactureDate.displayName=Manufacture date
+PhysicalElement.manufactureDate.description=The date that this PhysicalElement was manufactured.
+PhysicalElement.SKU.displayName=SKU
+PhysicalElement.SKU.description=The stock-keeping unit number for this PhysicalElement.
+PhysicalElement.PhysicalElementLocation.displayName=Physical element location
+PhysicalElement.PhysicalElementLocation.displayName=The physical location of the PhysicalElement.
+Service.displayName=Service
+Service.description=A Service is a Logical Element that contains the information that is necessary to represent and manage the functionality provided by a Device or a SoftwareFeature, or both. A Service is a general-purpose object that is used to configure and manage the implementation of functionality. It is not the functionality itself.
+Service.Started.displayName=Started
+Service.Started.description= Started is a Boolean that indicates whether the Service has been started (TRUE), or stopped (FALSE).
Modified: org.escapek.client.cmdb.en/trunk/META-INF/MANIFEST.MF
===================================================================
--- org.escapek.client.cmdb.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.cmdb.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:44:49 UTC (rev 814)
@@ -4,4 +4,3 @@
Bundle-SymbolicName: org.escapek.client.cmdb.en
Bundle-Version: 1.0.0
Fragment-Host: org.escapek.client.cmdb;bundle-version="1.0.0"
-Bundle-Localization: plugin
Deleted: org.escapek.client.cmdb.en/trunk/plugin_en.properties
===================================================================
--- org.escapek.client.cmdb.en/trunk/plugin_en.properties 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.cmdb.en/trunk/plugin_en.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,123 +0,0 @@
-#Properties
-AddressProperty.displayName=Address
-AddressProperty.description=Type used to stores physical addresses like street name, building, ...
-BooleanProperty.displayName=Boolean
-BooleanProperty.description=Used to store on/off , true/false values.
-IntegerProperty.displayName=Integer
-IntegerProperty.description=Integer value
-RegistryNodeProperty.displayName=Registry node
-RegistryNodeProperty.description=Registry node value
-DoubleProperty.displayName=Double
-DoubleProperty.description=Double decimal value
-StringProperty.displayName=String
-StringProperty.description=String value
-DateProperty.displayName=Date
-DateProperty.description=Date value
-
-#Relation Types
-InclusionRelationType.displayName=Inclusion
-InclusionRelationType.description=A relation type where a CI includes another
-
-#Relation classes
-ContainedLocation.displayName=Contained location
-ContainedLocation.description=Locations included into another
-
-#CI classes
-ConcreteJob.displayName=Concrete Job
-ConcreteJob.description=A concrete version of Job. This class represents a generic and instantiable unit of work, such as a batch or a print job.
-ConcreteJob.TimeOfLastStateChange.displayName=Time of last state change
-ConcreteJob.TimeOfLastStateChange.description=The date or time when the state of the Job last changed.
-ConcreteJob.JobState.displayName=Job state
-%ConcreteJob.JobState.description=JobState is an integer enumeration that indicates the operational state of a Job. It can also indicate transitions between these states, for example, 'Shutting Down' and 'Starting'.
-EnabledLogicalElement.displayName=Enabled logical element
-EnabledLogicalElement.description=This class extends LogicalElement to abstract the concept of an element that is enabled and disabled, such as a LogicalDevice or a ServiceAccessPoint.
-EnabledLogicalElement.TimeOfLastStateChange.displayName=Time of last state change
-EnabledLogicalElement.TimeOfLastStateChange.displayName=The date or time when the EnabledState of the element last changed.
-EnabledLogicalElement.OtherEnabledState.displayName=Other enabled state
-EnabledLogicalElement.OtherEnabledState.displayName A string that describes the enabled or disabled state of the element when the EnabledState property is set to 'Other'.
-EnabledLogicalelement.EnabledState.displayName=Enabled state
-EnabledLogicalelement.EnabledState.displayName=EnabledState indicates the enabled and disabled states of an element. It can also indicate the transitions between these requested states. For example, 'shutting down' 'starting' are transient states between enabled and disabled.
-EnabledLogicalElement.RequestedState.displayName=Requested state
-EnabledLogicalElement.RequestedState.description=RequestedState that indicates the last requested or desired state for the element. The actual state of the element is represented by EnabledState. This property is provided to compare the last requested and current enabled or disabled states. Note that when EnabledState is set to 5 'Not Applicable', then this property has no meaning. By default, the RequestedState of the element is 'No Change'. Refer to the EnabledState property description for explanations of the values in the RequestedState enumeration.
-Job.displayName=Job
-Job.description=A Job is a LogicalElement that represents an executing unit of work, such as a script or a print job. A Job is distinct from a Process in that a Job can be scheduled or queued, and its execution is not limited to a single system.
-Job.UntilTime.displayName=Until time
-Job.UntilTime.description= The time after which the Job is invalid or should be stopped.
-Job.RunDay.displayName=Run day
-Job.RunDay.description=The day in the month on which the Job should be processed. There are two different interpretations for this property, depending on the value of DayOfWeek. In one case, RunDay defines the day-in-month on which the Job is processed. This interpretation is used when the DayOfWeek is 0. A positive or negative integer indicates whether the RunDay should be calculated from the beginning or end of the month. For example, 5 indicates the fifth day in the RunMonth and -1 indicates the last day in the RunMonth.\nWhen RunDayOfWeek is not 0, RunDay is the day-in-month on which the Job is processed, defined in conjunction with RunDayOfWeek. For example, if RunDay is 15 and RunDayOfWeek is Saturday, then the Job is processed on the first Saturday on or after the 15th day in the RunMonth (for example, the third Saturday in the month). If RunDay is 20 and RunDayOfWeek is -Saturday, then this indicates the first Saturday on or before the 20th day in the RunMonth. If RunDay is -1 and RunDayOfWeek is -Sunday, then this indicates the last Sunday in the RunMonth.
-Job.JobStatus.displayName=Job status
-Job.JobStatus.description= A free-form string that represents the status of the job. The primary status is reflected in the inherited OperationalStatus property. JobStatus provides additional, implementation-specific details.
-Job.DeleteOnCompletion.displayName=Delete on completion
-Job.DeleteOnCompletion.description=Indicates whether or not the job should be automatically deleted upon completion. Note that the 'completion' of a recurring job is defined by its JobRunTimes or UntilTime properties, or when the Job is terminated by manual intervention. If this property is set to false and the job completes, then the extrinsic method DeleteInstance must be used to delete the job instead of updating this property.
-Job.RunStartInterval.displayName=Run start interval
-Job.RunStartInterval.description=The time interval after midnight when the Job should be processed.
-Job.ErrorDescription.displayName=Error description
-Job.ErrorDescription.description=A free-form string that contains the vendor error description.
-Job.ErrorCode.displayName=Error code
-Job.ErrorCode.description= A vendor-specific error code. The value must be set to zero if the Job completed without error.
-Job.TimeSubmitted.displayName=Time submitted
-Job.TimeSubmitted.description=The time that the Job was submitted to execute.
-Job.OtherRecoveryAction.displayName=Other recovery action
-Job.OtherRecoveryAction.description=A string describing the recovery action when the RecoveryAction property of the instance is 'Other'.
-Job.RunMonth.displayName=Run month
-Job.RunMonth.description=The month during which the Job should be processed.
-Job.RunDayOfWeek.displayName=Run day of week
-Job.RunDayOfWeek.description=A positive or negative integer used in conjunction with RunDay to indicate the day of the week on which the Job is processed. RunDayOfWeek is set to 0 to indicate an exact day of the month, such as March 1. A positive integer (representing Sunday, Monday, ..., Saturday) means that the day of week is found on or after the specified RunDay. A negative integer (representing -Sunday, -Monday, ..., -Saturday) means that the day of week is found on or BEFORE the RunDay.
-Job.JobRunTimes.displayName=Job run times
-Job.JobRunTimes.description= The number of times that the Job should be run. A value of 1 indicates that the Job is not recurring, while any non-zero value indicates a limit to the number of times that the Job will recur. Zero indicates that there is no limit to the number of times that the Job can be processed, but that it is terminated either after the UntilTime or by manual intervention.
-Job.ElapsedTime.displayName=Elapsed time
-Job.ElapsedTime.description= The time interval that the Job has been executing or the total execution time if the Job is complete.
-Job.StartTime.displayName=Start time
-Job.StartTime.description= The time that the Job was actually started.
-Job.RecoveryAction.displayName=Recovery action
-Job.RecoveryAction.description=Describes the recovery action to be taken for an unsuccessfully run Job.
-Job.LocalOrUtcTime.displayName=Local or UTC time
-Job.LocalOrUtcTime.description=This property indicates whether the times represented in the RunStartInterval and UntilTime properties represent local times or UTC times. Time values are synchronized worldwide by using the enumeration value 2, 'UTC Time'.
-Job.PercentComplete.displayName=Percent complete
-Job.PercentComplete.description=The percentage of the job that has completed at the time that this value is requested.
-Job.Priority.displayName=Priority
-Job.Priority.description=Indicates the urgency or importance of execution of the Job. The lower the number, the higher the priority.
-Location.displayName=Location
-Location.description=The Location class specifies the position and address of a PhysicalElement.
-Location.physicalLocation.displayName=Physical location
-Location.physicalLocation.description= Position is a free-form string that indicates the placement of a PhysicalElement. It can specify slot information on a HostingBoard, mounting site in a Cabinet, or latitude and longitude information, for example, from a GPS. It is part of the key of the Location object.
-Location.address.displayName=Address
-Location.address.description= Address indicates a street, building, or other type of address for the location of the PhysicalElement.
-LogicalElement.description=Logical element
-LogicalElement.description=LogicalElement is a base class for all the components of a System that represent abstract system components, such as Files, Processes, or LogicalDevices.
-ManagedSystemElement.displayName=Managed System element
-ManagedSystemElement.description=ManagedSystem is the base class for the System Element hierarchy. Any distinguishable component of a System is a candidate for inclusion in this class. Examples of system components include:\n- software components such as application servers, databases, and applications\n- operating system components such as files, processes, and threads\n- device components such as disk drives, controllers, processors, and printers\n- physical components such as chips and cards.
-ManagedSystemElement.installDate.displayName=Installation date
-ManagedSystemElement.installDate.description=Date indicating when the object was installed.
-ManagedSystemElement.statusDescription.diplayName=Status description
-ManagedSystemElement.statusDescription.description=String describing the the operational status.
-ManagedSystemElement.healthState.displayName=Health state
-ManagedSystemElement.healthState.description=Indicates the current health of the element. This attribute expresses the health of this element but not necessarily that of its subcomponents.
-ManagedSystemElement.operationalStatus.displayName=Operational status
-ManagedSystemElement.operationalStatus.description=Operational status of the element.
-PhysicalElement.displayName=Physical element
-PhysicalElement.description=Physical element define any component of a System that has a distinct physical identity. Instances of this class can be defined as an object that can be seen or touched. All Processes, Files, and LogicalDevices are considered not to be Physical Elements. For example, it is not possible to touch the functionality of a 'modem.' You can touch only the card or package that implements the modem. The same card could also implement a LAN adapter. PhysicalElements are tangible ManagedSystemElements that have a physical manifestation of some sort.
-PhysicalElement.vendorEquipmentType.displayName=Vendor equipement type
-PhysicalElement.vendorEquipmentType.description=Vendor-specific hardware type for the PhysicalElement. It describes the specific equipment type for the element, as defined by the vendor or manufacturer.
-PhysicalElement.model.displayName=Model
-PhysicalElement.model.description=The name by which the PhysicalElement is generally known.
-PhysicalElement.partNumber.displayName=Part number
-PhysicalElement.partNumber.description=The part number assigned by the organization that is responsible for producing or manufacturing the PhysicalElement.
-PhysicalElement.poweredOn.displayName=Powered on
-PhysicalElement.poweredOn.description=Boolean that indicates whether the PhysicalElement is powered on or is currently off.
-PhysicalElement.otherIdentifyingInfo.displayName=Other identifying information
-PhysicalElement.otherIdentifyingInfo.description=This information could be used to identify a Physical Element. One example is bar code data associated with an Element that also has an asset tag.
-PhysicalElement.serialNumber.displayName=Serial number
-PhysicalElement.serialNumber.description=A manufacturer-allocated number used to identify the Physical Element.
-PhysicalElement.userTracking.displayName=User tracking
-PhysicalElement.userTracking.description=User-assigned and writeable asset-tracking identifier for the PhysicalElement.
-PhysicalElement.manufactureDate.displayName=Manufacture date
-PhysicalElement.manufactureDate.description=The date that this PhysicalElement was manufactured.
-PhysicalElement.SKU.displayName=SKU
-PhysicalElement.SKU.description=The stock-keeping unit number for this PhysicalElement.
-PhysicalElement.PhysicalElementLocation.displayName=Physical element location
-PhysicalElement.PhysicalElementLocation.displayName=The physical location of the PhysicalElement.
-Service.displayName=Service
-Service.description=A Service is a Logical Element that contains the information that is necessary to represent and manage the functionality provided by a Device or a SoftwareFeature, or both. A Service is a general-purpose object that is used to configure and manage the implementation of functionality. It is not the functionality itself.
-Service.Started.displayName=Started
-Service.Started.description= Started is a Boolean that indicates whether the Service has been started (TRUE), or stopped (FALSE).
Modified: org.escapek.client.core/trunk/META-INF/MANIFEST.MF
===================================================================
--- org.escapek.client.core/trunk/META-INF/MANIFEST.MF 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.core/trunk/META-INF/MANIFEST.MF 2007-02-15 20:44:49 UTC (rev 814)
@@ -4,7 +4,6 @@
Bundle-SymbolicName: org.escapek.client.core;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.escapek.client.core.CoreActivator
-Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.escapek.server,
Modified: org.escapek.client.core/trunk/src/org/escapek/client/core/ui/databinding/DataBindingContextFactory.java
===================================================================
--- org.escapek.client.core/trunk/src/org/escapek/client/core/ui/databinding/DataBindingContextFactory.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.core/trunk/src/org/escapek/client/core/ui/databinding/DataBindingContextFactory.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -41,7 +41,6 @@
{
public static DataBindingContext create()
{
- Realm.setDefault(SWTObservables.getRealm(Display.getDefault()));
DataBindingContext bindingContext = new DataBindingContext();
return bindingContext;
}
Modified: org.escapek.client.tools/trunk/META-INF/MANIFEST.MF
===================================================================
--- org.escapek.client.tools/trunk/META-INF/MANIFEST.MF 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.tools/trunk/META-INF/MANIFEST.MF 2007-02-15 20:44:49 UTC (rev 814)
@@ -4,7 +4,6 @@
Bundle-SymbolicName: org.escapek.client.tools
Bundle-Version: 1.0.0
Bundle-Activator: org.escapek.client.tools.Activator
-Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.escapek.preferences,
Added: org.escapek.client.ui/trunk/plugin.properties
===================================================================
--- org.escapek.client.ui/trunk/plugin.properties (rev 0)
+++ org.escapek.client.ui/trunk/plugin.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -0,0 +1,4 @@
+DescriptionTab.name=Description
+GeneralTab.name=General
+NotesTab.name=Notes
+AccessRightsTab.name=Access rights
\ No newline at end of file
Modified: org.escapek.client.ui/trunk/src/org/escapek/client/ui/tools/FormTools.java
===================================================================
--- org.escapek.client.ui/trunk/src/org/escapek/client/ui/tools/FormTools.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui/trunk/src/org/escapek/client/ui/tools/FormTools.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -31,7 +31,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -44,7 +44,7 @@
public static Label createLabel(Composite parent, FormToolkit toolkit, String text)
{
Label label = toolkit.createLabel(parent, text);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
label.setLayoutData(createLabelGridData());
return label;
}
@@ -52,7 +52,7 @@
public static Label createLabel(Composite parent, FormToolkit toolkit, String text, GridData gd)
{
Label label = toolkit.createLabel(parent, text);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
label.setLayoutData(gd);
return label;
}
Added: org.escapek.client.ui.cmdb/trunk/plugin.properties
===================================================================
--- org.escapek.client.ui.cmdb/trunk/plugin.properties (rev 0)
+++ org.escapek.client.ui.cmdb/trunk/plugin.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -0,0 +1,6 @@
+PrimarySiteGroup.name=Primary sites
+NewLocationWizard.name=Location
+CMDBCategory.name=Repository objects
+AllSitesGroup.name=All sites
+LinkedSitesGroup.name=Linked sites
+NewCIClassWizard.name=CI class
Modified: org.escapek.client.ui.cmdb/trunk/src/org/escapek/client/ui/cmdb/providers/ContactContentProvider.java
===================================================================
--- org.escapek.client.ui.cmdb/trunk/src/org/escapek/client/ui/cmdb/providers/ContactContentProvider.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.cmdb/trunk/src/org/escapek/client/ui/cmdb/providers/ContactContentProvider.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -54,6 +54,7 @@
return null;
}
+ @SuppressWarnings("unchecked")
@Override
public Collection loadChildren(Object parent)
{
Modified: org.escapek.client.ui.cmdb.en/trunk/META-INF/MANIFEST.MF
===================================================================
--- org.escapek.client.ui.cmdb.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.cmdb.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:44:49 UTC (rev 814)
@@ -4,4 +4,3 @@
Bundle-SymbolicName: org.escapek.client.ui.cmdb.en
Bundle-Version: 1.0.0
Fragment-Host: org.escapek.client.ui.cmdb;bundle-version="1.0.0"
-Bundle-Localization: plugin
Modified: org.escapek.client.ui.cmdb.en/trunk/build.properties
===================================================================
--- org.escapek.client.ui.cmdb.en/trunk/build.properties 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.cmdb.en/trunk/build.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,2 +1 @@
-bin.includes = META-INF/,\
- plugin_en.properties
+bin.includes = META-INF/
Deleted: org.escapek.client.ui.cmdb.en/trunk/plugin_en.properties
===================================================================
--- org.escapek.client.ui.cmdb.en/trunk/plugin_en.properties 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.cmdb.en/trunk/plugin_en.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,6 +0,0 @@
-PrimarySiteGroup.name=Primary sites
-NewLocationWizard.name=Location
-CMDBCategory.name=Repository objects
-AllSitesGroup.name=All sites
-LinkedSitesGroup.name=Linked sites
-NewCIClassWizard.name=CI class
Modified: org.escapek.client.ui.en/trunk/META-INF/MANIFEST.MF
===================================================================
--- org.escapek.client.ui.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.en/trunk/META-INF/MANIFEST.MF 2007-02-15 20:44:49 UTC (rev 814)
@@ -4,4 +4,3 @@
Bundle-SymbolicName: org.escapek.client.ui.en
Bundle-Version: 1.0.0
Fragment-Host: org.escapek.client.ui;bundle-version="1.0.0"
-Bundle-Localization: plugin
Modified: org.escapek.client.ui.en/trunk/build.properties
===================================================================
--- org.escapek.client.ui.en/trunk/build.properties 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.en/trunk/build.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,2 +1 @@
-bin.includes = META-INF/,\
- plugin_en.properties
+bin.includes = META-INF/
Deleted: org.escapek.client.ui.en/trunk/plugin_en.properties
===================================================================
--- org.escapek.client.ui.en/trunk/plugin_en.properties 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.en/trunk/plugin_en.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,4 +0,0 @@
-DescriptionTab.name=Description
-GeneralTab.name=General
-NotesTab.name=Notes
-AccessRightsTab.name=Access rights
\ No newline at end of file
Added: org.escapek.client.ui.security/trunk/plugin.properties
===================================================================
--- org.escapek.client.ui.security/trunk/plugin.properties (rev 0)
+++ org.escapek.client.ui.security/trunk/plugin.properties 2007-02-15 20:44:49 UTC (rev 814)
@@ -0,0 +1,8 @@
+RoleEditor.name=Role editor
+RoleView.name=Roles
+NewRoleWizard.name=Role
+NewUserWizard.name=User
+SecurityCategory.name=Security
+SecurityPerspective.name=Security
+UserEditor.name=User editor
+UserView.name=Users
\ No newline at end of file
Modified: org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/RoleMainFormPage.java
===================================================================
--- org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/RoleMainFormPage.java 2007-02-15 20:42:53 UTC (rev 813)
+++ org.escapek.client.ui.security/trunk/src/org/escapek/client/ui/security/editors/forms/RoleMainFormPage.java 2007-02-15 20:44:49 UTC (rev 814)
@@ -1,321 +1,379 @@
-/**
- * Escape-K
- * Copyright (C) 2006 Nicolas Jouanin, and individual contributors
- * as indicated by the @authors tag. See copyright.txt in the
- * distribution for a full listing of individual contributors.
- * Contact: es...@gm...
- *
- * This file is part of Escape-K.
- *
- * Escape-K is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Escape-K 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 the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Foobar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * --------------------------------------------------------------------------
- * $Id$
- * --------------------------------------------------------------------------
- */
-package org.escapek.client.ui.security.editors.forms;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.databinding.BindingEvent;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.IBindingListener;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-import org.escapek.client.core.services.ObjectChangeService;
-import org.escapek.client.core.ui.EscapeKFormPage;
-import org.escapek.client.core.ui.databinding.DataBindingContextFactory;
-import org.escapek.client.ui.security.SecurityActivator;
-import org.escapek.client.ui.security.editors.RoleEditorInput;
-import org.escapek.client.ui.security.editors.forms.providers.RoleGrantedUserLabelProvider;
-import org.escapek.client.ui.tools.FormTools;
-import org.escapek.core.dto.security.RoleDTO;
-import org.escapek.core.dto.security.TicketDTO;
-import org.escapek.core.dto.security.UserDTO;
-import org.escapek.core.exceptions.EntityNotFoundException;
-import org.escapek.core.exceptions.SecurityException;
-import org.escapek.core.serviceManager.ServiceWrapper;
-import org.escapek.core.serviceManager.Exceptions.ConnectionException;
-import org.escapek.core.services.interfaces.IRemoteSecurityService;
-import org.escapek.i18n.LocaleService;
-import org.escapek.i18n.MessageService;
-import org.escapek.logger.LoggerPlugin;
-import org.escapek.logger.LoggingConstants;
-
-/**
- *
- * @author nicolasjouanin
- *
- */
-public class RoleMainFormPage extends EscapeKFormPage
- implements IBindingListener
-{
- private RoleDTO editedRole;
- private List<UserDTO> userList;
- private FormToolkit toolkit;
- private String title;
- private Text nameText;
- private Text descText;
- private TableViewer userViewer;
- private Button addUserButton;
- private Button delUserButton;
- private boolean dirty;
- private DataBindingContext bindingContext;
-
- private MessageService message;
- private MessageService commonMessages;
-
- private IRemoteSecurityService securityService;
-
- public RoleMainFormPage(FormEditor editor, String id, String title)
- {
- super(editor, id, title);
- this.title = title;
- message = LocaleService.getMessageService(LocaleService.uiMessages);
- commonMessages = LocaleService.getMessageService(LocaleService.commonMessages);
-
- dirty = false;
- editedRole = ((RoleEditorInput)(editor.getEditorInput())).getRole();
- userList = new ArrayList<UserDTO>();
-
- try
- {
- securityService = ServiceWrapper.getInstance().getSecurityService();
- }
- catch (ConnectionException e)
- {
- //This exception should have already been tested
- LoggerPlugin.LogWarning(SecurityActivator.PLUGIN_ID, LoggingConstants.UNEXPECTED_EXCEPTION,
- "Couldn't get Security service", e);
- }
- }
-
- @Override
- protected void createFormContent(IManagedForm managedForm)
- {
- toolkit = managedForm.getToolkit();
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 2;
- managedForm.getForm().getBody().setLayout(layout);
- managedForm.getForm().setText(this.title);
-
- createMainSection(managedForm);
- createGrantedUserSection(managedForm);
-
- //Data binding
- bindGUI();
- }
-
- private void createMainSection(IManagedForm managedForm)
- {
- GridData data = new GridData();
- Section dataSection = toolkit.createSection(managedForm.getForm().getBody(),
- Section.TITLE_BAR|Section.EXPANDED);
- TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
- td.colspan = 2;
- dataSection.setLayoutData(td);
- dataSection.setText(message.getString("roleEditor.mainForm.dataSection.title"));
-
- Composite sectionClient = toolkit.createComposite(dataSection);
- GridLayout clientLayout = new GridLayout();
- clientLayout.numColumns = 2;
- sectionClient.setLayout(clientLayout);
-
- //Id
- FormTools.createLabel(sectionClient, toolkit, commonMessages.getString("common.repId.label"));
- Text idText = toolkit.createText(sectionClient, "", SWT.BORDER | SWT.READ_ONLY);
- idText.setText(editedRole.getId().toString());
- idText.setEditable(false);
- data = new GridData(SWT.LEFT, SWT.FILL, false, false);
- idText.setLayoutData(data);
-
- //Name
- data = new GridData(SWT.FILL, SWT.TOP, false, false);
- FormTools.createLabel(sectionClient, toolkit, message.getString("roleEditor.mainForm.dataSection.name.label"), data);
- nameText = toolkit.createText(sectionClient, "", SWT.BORDER);
- data = new GridData(SWT.FILL, SWT.FILL, true, false);
- nameText.setLayoutData(data);
-
- data = new GridData(SWT.FILL, SWT.TOP, false, false);
- FormTools.createLabel(sectionClient, toolkit, commonMessages.getString("common.description.label"), data);
-
- //Description
- descText = toolkit.createText(sectionClient, "", SWT.MULTI);
- descText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.heightHint = 50;
- descText.setLayoutData(data);
-
- toolkit.paintBordersFor(dataSection);
- dataSection.setClient(sectionClient);
-
- }
-
- private void createGrantedUserSection(IManagedForm managedForm)
- {
- GridData data = new GridData();
- Section section = toolkit.createSection(managedForm.getForm().getBody(),
- Section.TITLE_BAR|Section.EXPANDED);
- TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
- td.colspan = 2;
- section.setLayoutData(td);
- section.setText(message.getString("roleEditor.mainForm.grantedUserSection.title"));
-
- Composite sectionClient = toolkit.createComposite(section);
- GridLayout clientLayout = new GridLayout();
- clientLayout.numColumns = 2;
- sectionClient.setLayout(clientLayout);
-
- Table memberTable = toolkit.createTable(sectionClient, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
- TableColumn loginColumn = new TableColumn(memberTable, SWT.LEFT);
- loginColumn.setText(commonMessages.getString("common.login.columnText"));
- loginColumn.setWidth(100);
- memberTable.setHeaderVisible(true);
- TableColumn descColumn = new TableColumn(memberTable, SWT.LEFT);
- descColumn.setText(commonMessages.getString("common.desc.columnText"));
- descColumn.setWidth(400);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.heightHint = 200;
- data.verticalSpan = 2;
- memberTable.setLayoutData(data);
- userViewer = new TableViewer(memberTable);
-
- addUserButton = toolkit.createButton(sectionClient,
- commonMessages.getString("common.addButton.text"), SWT.NONE);
- data = new GridData(SWT.FILL, SWT.TOP, false, false);
- addUserButton.setLayoutData(data);
- delUserButton = toolkit.createButton(sectionClient,
- commonMessages.getString("common.delButton.text"), SWT.NONE);
- data = new GridData(SWT.FILL, SWT.TOP, false, false);
- delUserButton.setLayoutData(data);
- toolkit.paintBordersFor(section);
- section.setClient(sectionClient);
- }
-
- protected void bindGUI()
- {
- bindingContext = DataBindingContextFactory.create();
- bindingContext.bindValue(SWTObservables.observeText(nameText, SWT.Modify),
- BeansObservables.observeValue(editedRole, "name"), null);
- bindingContext.bindValue(SWTObservables.observeText(descText, SWT.Modify),
- BeansObservables.observeValue(editedRole, "description"), null);
-
- //Tables Binding
- ObservableListContentProvider memberViewerContentProvider = new ObservableListContentProvider();
- userViewer.setContentProvider(memberViewerContentProvider);
- IObservableMap[] attributeMaps = BeansObservables.observeMaps(
- memberViewerContentProvider.getKnownElements(), UserDTO.class,
- new String[] { "loginString" ,"description"});
- userViewer.setLabelProvider(new RoleGrantedUserLabelProvider(attributeMaps));
-
- try
- {
- TicketDTO ticket = ServiceWrapper.getInstance().getTicket();
- Collection<UserDTO> users = securityService.getRoleGrantedUsers(ticket.getId(), editedRole.getId());
- if(users != null)
- userList.addAll(users);
- userViewer.setInput(new WritableList(SWTObservables.getRealm(Display.getDefault()), userList, UserDTO.class));
- }
- catch(SecurityException e)
- {
-
- }
- //Modification listener
- bindingContext.addBindingEventListener(this);
- }
-
- public IStatus bindingEvent(BindingEvent e)
- {
- if(e.copyType == BindingEvent.EVENT_COPY_TO_MODEL &&
- e.pipelinePosition == BindingEvent.PIPELINE_AFTER_GET &&
- !dirty)
- {
- dirty = true;
- firePropertyChange(PROP_DIRTY);
- }
- return Status.OK_STATUS;
- }
-
- @Override
- public void doSave(IProgressMonitor monitor)
- {
- monitor.beginTask(message.getString("roleEditor.info.saveInProgress"), 3);
- bindingContext.updateModels();
- monitor.worked(1);
- try
- {
- IRemoteSecurityService security = ServiceWrapper.getInstance().getSecurityService();
- TicketDTO ticket = ServiceWrapper.getInstance().getTicket();
- RoleDTO updatedRole = security.updateRole(ticket.getId(), editedRole);
- monitor.worked(1);
- editedRole.setName(updatedRole.getName());
- editedRole.setDescription(updatedRole.getDescription());
- bindingContext.updateTargets();
- monitor.worked(1);
- }
- catch (ConnectionException e)
- {
- monitor.setCanceled(true);
- }
- catch (EntityNotFoundException e)
- {
- monitor.setCanceled(true);
- }
- catch (SecurityException e)
- {
- monitor.setCanceled(true);
- //TODO : manage it
- }
- monitor.done();
- ObjectChangeService.getInstance().fireObjectChanged(editedRole);
- }
-
- @Override
- public boolean isDirty()
- {
- return dirty;
- }
-
- @Override
- public void dispose()
- {
- editedRole = null;
- super.dispose();
- }
-}
+/**
+ * Escape-K
+ * Copyright (C) 2006 Nicolas Jouanin, and individual contributors
+ * as indicated by the @authors tag. See copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ * Contact: es...@gm...
+ *
+ * This file is part of Escape-K.
+ *
+ * Escape-K is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Escape-K 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 the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * --------------------------------------------------------------------------
+ * $Id$
+ * --------------------------------------------------------------------------
+ */
+package org.escapek.client.ui.security.editors.forms;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.databinding.BindingEvent;
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.IBindingListener;
+import org.eclipse.core.databinding.beans.BeansObservables;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.map.IObservableMap;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.escapek.client.core.services.ObjectChangeService;
+import org.escapek.client.core.ui.EscapeKFormPage;
+import org.escapek.client.core.ui.databinding.DataBindingContextFactory;
+import org.escapek.client.ui.security.SecurityActivator;
+import org.escapek.client.ui.security.editors.RoleEditorInput;
+import org.escapek.client.ui.security.editors.forms.providers.ObservableUserLabelProvider;
+import org.escapek.client.ui.tools.FormTools;
+import org.escapek.core.dto.security.RoleDTO;
+import org.escapek.core.dto.security.TicketDTO;
+import org.escapek.core.dto.security.UserDTO;
+import org.escapek.core.exceptions.EntityNotFoundException;
+import org.escapek.core.exceptions.SecurityException;
+import org.escapek.core.serviceManager.ServiceWrapper;
+import org.escapek.core.serviceManager.Exceptions.ConnectionException;
+import org.escapek.core.services.interfaces.IRemoteSecurityService;
+import org.escapek.i18n.LocaleService;
+import org.escapek.i18n.MessageService;
+import org.escapek.logger.LoggerPlugin;
+import org.escapek.logger.LoggingConstants;
+
+/**
+ *
+ * @author nicolasjouanin
+ *
+ */
+public class RoleMainFormPage extends EscapeKFormPage
+ implements IBindingListener
+{
+ private RoleDTO editedRole;
+ private List<UserDTO> userList;
+ private List<RoleDTO> roleList;
+ private FormToolkit toolkit;
+ private String title;
+ private Text nameText;
+ private Text descText;
+ private TableViewer userViewer;
+ private TableViewer roleViewer;
+ private Button addUserButton;
+ private Button delUserButton;
+ private Button addRoleButton;
+ private Button delRoleButton;
+ private boolean dirty;
+ private DataBindingContext bindingContext;
+
+ private MessageService message;
+ private MessageService commonMessages;
+
+ private IRemoteSecurityService securityService;
+
+ public RoleMainFormPage(FormEditor editor, String id, String title)
+ {
+ super(editor, id, title);
+ this.title = title;
+ message = LocaleService.getMessageService(LocaleService.uiMessages);
+ commonMessages = LocaleService.getMessageService(LocaleService.commonMessages);
+
+ dirty = false;
+ editedRole = ((RoleEditorInput)(editor.getEditorInput())).getRole();
+ userList = new ArrayList<UserDTO>();
+
+ try
+ {
+ securityService = ServiceWrapper.getInstance().getSecurityService();
+ }
+ catch (ConnectionException e)
+ {
+ //This exception should have already been tested
+ LoggerPlugin.LogWarning(SecurityActivator.PLUGIN_ID, LoggingConstants.UNEXPECTED_EXCEPTION,
+ "Couldn't get Security service", e);
+ }
+ }
+
+ @Override
+ protected void createFormContent(IManagedForm managedForm)
+ {
+ toolkit = managedForm.getToolkit();
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.numColumns = 2;
+ managedForm.getForm().getBody().setLayout(layout);
+ managedForm.getForm().setText(this.title);
+
+ createMainSection(managedForm);
+ //createInheritedRoleSection(managedForm);
+ createMemberUserSection(managedForm);
+
+ //Data binding
+ bindGUI();
+ }
+
+ private void createMainSection(IManagedForm managedForm)
+ {
+ GridData data = new GridData...
[truncated message content] |