diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/Main.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/Main.java index 51bd549ee6f6f9b44e19a71fea0d5adbbfeef674..8a1be62a1ce623df19ca214966cee17799895f21 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/Main.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/Main.java @@ -66,12 +66,13 @@ public class Main { private static void handleOpenDatabaseException(Exception exception) { // Display a generic message for other error. - DetailMessageDialog.openDetailWarning( - null, - Display.getAppName(), - _("Une erreur s'est produite lors de l'ouverture de la base de données."), - _("Vérifiez qu'il est possible d'établir une communication avec l'ordinateur distante."), - exception); + DetailMessageDialog + .openDetailWarning( + null, + Display.getAppName(), + _("Une erreur s'est produite lors de l'ouverture de la base de données."), + _("Vérifiez qu'il est possible d'établir une communication avec l'ordinateur distante."), + exception); } /** @@ -86,12 +87,13 @@ public class Main { Throwable cause = exception; while (cause != null) { if (cause.getMessage().contains("not found")) { - DetailMessageDialog dlg = DetailMessageDialog.openDetailYesNoQuestion( - null, - _("Ouverture de la base de donnée"), - _("Une erreur s'est produite lors de l'ouverture de la base de données."), - _("La base de données sélectionnée n'existe pas. Voulez vous créer cette nouvelle base de données ?"), - null); + DetailMessageDialog dlg = DetailMessageDialog + .openDetailYesNoQuestion( + null, + _("Ouverture de la base de donnée"), + _("Une erreur s'est produite lors de l'ouverture de la base de données."), + _("La base de données sélectionnée n'existe pas. Voulez vous créer cette nouvelle base de données ?"), + null); return IDialogConstants.YES_ID == dlg.getReturnCode(); } cause = cause.getCause(); @@ -119,7 +121,8 @@ public class Main { null, Display.getAppName(), _("La base de données ne peut être ouverte en mode lecture-écriture. En ouvrir une copie ?"), - _("Il se peut que vous n'ayez pas les droits suffisant pour ouvrir la base de données en mode lecture-écriture. Il vous est toutefois possible d'en ouvrir une copie. Toute modification apportée à cette copie ne peut être sauvegardée"), + _( + "Il se peut que vous n'ayez pas les droits suffisant pour ouvrir la base de données en mode lecture-écriture. Il vous est toutefois possible d'en ouvrir une copie. Toute modification apportée à cette copie ne peut être sauvegardée"), null); return IDialogConstants.YES_ID == dlg.getReturnCode(); } @@ -136,7 +139,8 @@ public class Main { null, Display.getAppName(), _("La base de données est verrouillée. Voulez-vous en ouvrir une copie ?"), - _("La base de données semble être verrouillée par un autre utilisateur. Il vous est toutefois possible d'ouvrir une copie. Toute modification apportée à cette copie ne peut être sauvegardée."), + _( + "La base de données semble être verrouillée par un autre utilisateur. Il vous est toutefois possible d'ouvrir une copie. Toute modification apportée à cette copie ne peut être sauvegardée."), null); return IDialogConstants.YES_ID == dlg.getReturnCode(); } @@ -196,11 +200,7 @@ public class Main { // Set default application image to be use by all JFace // Window - Window.setDefaultImages(new Image[] { - Resources.getImage(Resources.APP_ICON_16), - Resources.getImage(Resources.APP_ICON_22), - Resources.getImage(Resources.APP_ICON_48), - Resources.getImage(Resources.APP_ICON_128) }); + Window.setDefaultImages(new Image[] { Resources.getImage(Resources.APP_ICON_128), Resources.getImage(Resources.APP_ICON_48) }); WindowManager winManager = new WindowManager(); PlanimodManagers managers = null; diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/admin/position/PositionPageViewPart.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/admin/position/PositionPageViewPart.java index bdf3dd54d35532eda0749fbe67b465b4508a5d88..d7c5a18a62286c454d5e0ea4f32ebef948f25253 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/admin/position/PositionPageViewPart.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/admin/position/PositionPageViewPart.java @@ -67,7 +67,7 @@ public class PositionPageViewPart extends AbstractViewPart { /** * Localized string to identify classified position. */ - static final String CLASSIFIED = _("Classifié"); + static final String CLASSIFIED = _("Attitré"); /** * Converter used to filter the content of the view. */ @@ -162,9 +162,10 @@ public class PositionPageViewPart extends AbstractViewPart { * Bind remove action */ IObservableList selections = ViewerProperties.multipleSelection().observe(this.viewer); - getDbc().bindValue( - JFaceProperties.value(RemoveAction.class, RemoveAction.OBJECTS, RemoveAction.OBJECTS).observe(this.removeAction), - new ListObservableValue(selections, AbstractCalendarEvent.class)); + getDbc() + .bindValue( + JFaceProperties.value(RemoveAction.class, RemoveAction.OBJECTS, RemoveAction.OBJECTS).observe(this.removeAction), + new ListObservableValue(selections, AbstractCalendarEvent.class)); } @@ -179,30 +180,40 @@ public class PositionPageViewPart extends AbstractViewPart { protected void createColumns(TableViewer viewer, IObservableSet knownPositions) { // RefId IBeanValueProperty redIfProperty = BeanProperties.value(Position.class, Position.REFID, String.class); - ColumnSupport.create(viewer, _("No."), knownPositions, redIfProperty).setWidth(75).addPropertySorting().addTextEditingSupport( - getDbc(), - new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), - null); + ColumnSupport + .create(viewer, _("No."), knownPositions, redIfProperty) + .setWidth(75) + .addPropertySorting() + .addTextEditingSupport( + getDbc(), + new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), + null); // Name IBeanValueProperty nameProperty = BeanProperties.value(Position.class, Position.NAME, String.class); - ColumnSupport.create(viewer, _("Nom"), knownPositions, nameProperty).setWidth(150).addPropertySorting().addTextEditingSupport( - getDbc(), - new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), - null); + ColumnSupport + .create(viewer, _("Nom"), knownPositions, nameProperty) + .setWidth(150) + .addPropertySorting() + .addTextEditingSupport( + getDbc(), + new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), + null); // Section IObservableSet proposedSections = PlanimodObservables.listSection(getSite().getService(PlanimodManagers.class)); - IValueProperty proposedSectionLabel = BeanProperties.value(Section.class, Section.NAME).value( - BindingProperties.convertedValue(Converters.removeFrontNumber())); + IValueProperty proposedSectionLabel = BeanProperties + .value(Section.class, Section.NAME) + .value(BindingProperties.convertedValue(Converters.removeFrontNumber())); ComboBoxViewerCellEditor comboBoxCellEditor = new ComboBoxViewerCellEditor(viewer.getTable(), SWT.READ_ONLY); ComboViewer comboViewer = comboBoxCellEditor.getViewer(); comboViewer.setComparator(new PropertyViewerComparator(SectionComparators.byName())); ViewerSupport.bind(comboViewer, proposedSections, proposedSectionLabel); IValueProperty sectionProperty = BeanProperties.value(Position.class, Position.SECTION, Section.class); - IValueProperty sectionLabel = BeanProperties.value(Position.class, Position.SECTION + DOT + Section.NAME).value( - BindingProperties.convertedValue(Converters.removeFrontNumber())); + IValueProperty sectionLabel = BeanProperties + .value(Position.class, Position.SECTION + DOT + Section.NAME) + .value(BindingProperties.convertedValue(Converters.removeFrontNumber())); ColumnSupport .create(viewer, _("Section"), knownPositions, sectionLabel) .setWidth(150) @@ -218,20 +229,27 @@ public class PositionPageViewPart extends AbstractViewPart { // Classified IValueProperty classifiedProperty = BeanProperties.value(Position.class, Position.CLASSIFIED, Boolean.TYPE); IValueProperty classifiedLabel = classifiedProperty.value(BindingProperties.convertedValue(Converters.booleanConverter())); - ColumnSupport.create(viewer, _("Classifié"), knownPositions, classifiedLabel).addPropertySorting().addCheckboxEditingSupport( - getDbc(), - classifiedProperty, - new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), - null); + ColumnSupport + .create(viewer, _("Attitré"), knownPositions, classifiedLabel) + .setToolTipText(_("Cocher si le poste peut être attitré à un employé.")) + .addPropertySorting() + .addCheckboxEditingSupport( + getDbc(), + classifiedProperty, + new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), + null); // Swappable IBeanValueProperty swappableProperty = BeanProperties.value(Position.class, Position.SWAPPABLE, Boolean.TYPE); IValueProperty swappablesLabel = swappableProperty.value(BindingProperties.convertedValue(Converters.booleanConverter())); - ColumnSupport.create(viewer, _("Permutable"), knownPositions, swappablesLabel).addPropertySorting().addCheckboxEditingSupport( - getDbc(), - swappableProperty, - new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), - null); + ColumnSupport + .create(viewer, _("Permutable"), knownPositions, swappablesLabel) + .addPropertySorting() + .addCheckboxEditingSupport( + getDbc(), + swappableProperty, + new ManagerUpdateValueStrategy(getSite().getService(PlanimodManagers.class), UpdateValueStrategy.POLICY_CONVERT), + null); ColumnViewerPreferences.create(viewer, PlanimodPreferences.getPreferenceStore(), PREFERENCE_COLUMNS); } diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/EmployeeViewPart.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/EmployeeViewPart.java index 621eb1762b6d3006115ba352344007e93222e888..f738ef3bf8ccba368148bb4e0693db1717f37101 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/EmployeeViewPart.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/EmployeeViewPart.java @@ -365,24 +365,24 @@ public class EmployeeViewPart extends AbstractViewPart { this.preferredSeniorityButton = new Button(comp, SWT.CHECK); this.preferredSeniorityButton.setText(_("Ancienneté privilégiée")); /* - * Preferred section + * Preferred Position */ Group group = new Group(comp, SWT.NONE); group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); group.setLayout(new GridLayout(2, false)); group.setText(_("Préférences")); label = new Label(group, SWT.NONE); - label.setText(_("Section préférée :")); - this.preferredSectionViewer = new ComboViewer(group, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN); - /* - * Preferred Position - */ - label = new Label(group, SWT.NONE); - label.setText(_("Poste préféré :")); + label.setText(_("Poste attitré :")); ActionContributionItem preferredPositionContributionItem = new ActionContributionItem( this.preferredPositionAction = new EmployeeEditPreferredPositionAction(managers, getSite())); preferredPositionContributionItem.fill(group); - ((Control) preferredPositionContributionItem.getWidget()).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + ((Control) preferredPositionContributionItem.getWidget()).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + /* + * Preferred section + */ + label = new Label(group, SWT.NONE); + label.setText(_("Section préférée :")); + this.preferredSectionViewer = new ComboViewer(group, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN); /* * Preferred shifts */ @@ -482,7 +482,7 @@ public class EmployeeViewPart extends AbstractViewPart { ColumnSupport.create(viewer, _("Section préférée"), employeePreferences, preferredSectionLabel).setWidth(150).addPropertySorting(); // Preferred Position IValueProperty preferredPositionLabel = new EmployeePreferredPositionValueProperty(); - ColumnSupport.create(viewer, _("Poste préféré"), employeePreferences, preferredPositionLabel).addPropertySorting(); + ColumnSupport.create(viewer, _("Poste attitré"), employeePreferences, preferredPositionLabel).addPropertySorting(); // Column preferences ColumnViewerPreferences.create(viewer, PlanimodPreferences.getPreferenceStore(), PREFERENCE_COLUMNS); } diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/PreferredPositionDialog.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/PreferredPositionDialog.java index ca675ae3b10d4e9867fc3d47ed912b1949607bde..5999a79578a3f2e1d6cbdd702840bfe37ba8524b 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/PreferredPositionDialog.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/employees/PreferredPositionDialog.java @@ -167,9 +167,9 @@ public class PreferredPositionDialog extends TitleAreaDialog { Team shift = (Team) PreferredPositionDialog.this.shift.getValue(); Position position = (Position) PreferredPositionDialog.this.position.getValue(); if (shift == null && position == null) { - return ValidationStatus.info(_("Aucun poste préféré.")); + return ValidationStatus.info(_("Aucun poste attitré.")); } else if (!(shift != null && position != null) && (shift != null || position != null)) { - return ValidationStatus.error(_("Sélectionnez l'équipe de travail ainsi que le poste préféré de l'employé.")); + return ValidationStatus.error(_("Sélectionnez l'équipe de travail ainsi que le poste attitré de l'employé.")); } return ValidationStatus.ok(); @@ -179,7 +179,7 @@ public class PreferredPositionDialog extends TitleAreaDialog { // Bind the title area to the binding context TitleAreaDialogSupport.create(this, this.dbc).setValidationMessageProvider( - new DefaultValidationMessageProvider(_("Sélectionnez l'équipe de travail ainsi que le poste préféré de l'employé."))); + new DefaultValidationMessageProvider(_("Sélectionnez l'équipe de travail ainsi que le poste attitré de l'employé."))); // Bind the status to the OK button UpdateValueStrategy modelToTarget = new UpdateValueStrategy(); @@ -213,8 +213,8 @@ public class PreferredPositionDialog extends TitleAreaDialog { composite.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true)); // Setup the title area - getShell().setText(_("Poste préféré")); - setTitle(_("Modifier le poste préféré d'un employé")); + getShell().setText(_("Poste attitré")); + setTitle(_("Modifier le poste attitré d'un employé")); setTitleImage(Resources.getImage(Resources.DLG_EDIT_TITLE_IMAGE)); // Shift selection diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/nonavailabilities/NonAvailabilitiesViewPart.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/nonavailabilities/NonAvailabilitiesViewPart.java index 5252b6e7ff26fbedd53810590452f158d5fa4145..f5ac73e07148019658734c19d689b8ad9bbdb8cd 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/nonavailabilities/NonAvailabilitiesViewPart.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/nonavailabilities/NonAvailabilitiesViewPart.java @@ -253,20 +253,20 @@ public class NonAvailabilitiesViewPart extends AbstractViewPart { /* * Bind the planner viewer (visible availabilities) */ + IObservableSet nonAvailabilities = filter(new NonAvailabilitiesComputedSet(getSite().getService(PlanimodManagers.class), timeRange, true), CONVERTER); ObservableSetContentProvider oscp = new ObservableSetContentProvider(new PlannerViewerUpdater(this.viewer)); this.viewer.setContentProvider(oscp); this.viewer.setComparator(new PropertyViewerComparator(NonAvailabilityComparators.byDateAndEmployeeName())); this.viewer.setLabelProvider(createPlannerLabelProvider(oscp.getKnownElements())); - this.viewer.setInput(filter(new NonAvailabilitiesComputedSet(getSite().getService(PlanimodManagers.class), timeRange, true), CONVERTER)); + this.viewer.setInput(nonAvailabilities); DateColorControlStyleSupport.create(this.viewer.getPlanner(), date); /* * Bind table viewer (hidden non-availabilities) */ - IObservableSet longNonAvailabilities = new NonAvailabilitiesComputedSet(getSite().getService(PlanimodManagers.class), timeRange, false); ObservableSetContentProvider oscp2 = new ObservableSetContentProvider(); this.longEventViewer.setContentProvider(oscp2); createColumns(this.longEventViewer, oscp2.getKnownElements()); - this.longEventViewer.setInput(filter(longNonAvailabilities, CONVERTER)); + this.longEventViewer.setInput(nonAvailabilities); /* * Bind actions */ diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/planif/ProposedWarningsToStringConverter.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/planif/ProposedWarningsToStringConverter.java index a61439e69cd7a83a8edb903b1971be35e47ce21b..7202b9262e8350d20da342bc7b2dfe5a903e253c 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/planif/ProposedWarningsToStringConverter.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/planif/ProposedWarningsToStringConverter.java @@ -118,7 +118,7 @@ public class ProposedWarningsToStringConverter extends Converter { } private static String getWarningMessage() { - return _("

L'employé est affecté par défaut à un poste classifié. Il peut toutefois refuser pour être affecté à son équipe de travail préférée."); + return _("

L'employé est affecté par défaut à un poste attitré. Il peut toutefois refuser pour être affecté à son équipe de travail préférée."); } /** diff --git a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/shifts/ShiftDialog.java b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/shifts/ShiftDialog.java index f9920447515ca20e7ffa132aa484e5bd4b9ca7cb..8e4be4d2a8b610137ef5e6a2fdd8d366c88c78d9 100644 --- a/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/shifts/ShiftDialog.java +++ b/com.patrikdufresne.planimod/src/main/java/com/planimod/ui/views/shifts/ShiftDialog.java @@ -296,7 +296,7 @@ public class ShiftDialog extends TitleAreaDialog { compShift.setLayout(layout); compShift.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); Label label = new Label(compShift, SWT.NONE); - label.setText(_("Nom du quart :")); + label.setText(_("Équipe de travaille :")); this.teamViewer = new ComboViewer(compShift); this.teamViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); diff --git a/pom.xml b/pom.xml index 4df02fa11d9ce317c7de1e7e8bc10a1552c03073..b65190f304549e3fc73d79c8114607d5a6d9e938 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.patrikdufresne swt - 3.109.0.2 + 3.109.0.3 planimod-parent ${revision}