diff --git a/src/main/java/fr/soleil/bensikin/actions/context/AddSelectedContextAttributesAction.java b/src/main/java/fr/soleil/bensikin/actions/context/AddSelectedContextAttributesAction.java index 96923f9acf729924167f5e591e0426e05f39d37d..830e2efa6bd9befd3cbfc37440237d09e3a286ff 100644 --- a/src/main/java/fr/soleil/bensikin/actions/context/AddSelectedContextAttributesAction.java +++ b/src/main/java/fr/soleil/bensikin/actions/context/AddSelectedContextAttributesAction.java @@ -57,6 +57,7 @@ import fr.soleil.bensikin.actions.BensikinAction; import fr.soleil.bensikin.components.context.detail.ContextAttributesTree; import fr.soleil.bensikin.components.context.detail.PossibleAttributesTree; import fr.soleil.bensikin.containers.context.ContextActionPanel; +import fr.soleil.bensikin.containers.context.ContextDataPanel; import fr.soleil.bensikin.models.ContextAttributesTreeModel; import fr.soleil.bensikin.tools.Messages; @@ -89,7 +90,7 @@ public class AddSelectedContextAttributesAction extends BensikinAction { } @Override - public void actionPerformed(final ActionEvent arg0) { + public void actionPerformed(final ActionEvent evt) { final PossibleAttributesTree leftTree = PossibleAttributesTree.getInstance(); final List<TreePath> listToAdd = leftTree.getListOfAttributesTreePathUnderSelectedNodes(false); @@ -97,20 +98,19 @@ public class AddSelectedContextAttributesAction extends BensikinAction { final ContextAttributesTreeModel model = ContextAttributesTreeModel.getInstance(false); try { - // ArrayList<TreePath> paths = model.addSelectedAttributes( - // listToAdd, true); model.addSelectedAttributes(listToAdd, true); model.reload(); if (ContextAttributesTree.getInstance() != null) { - // for (int i = 0; i < paths.size(); i++) { - // ContextAttributesTree.getInstance().makeVisible( - // paths.get(i)); - // } ContextAttributesTree.getInstance().expandAll(true); } - // paths.clear(); - // paths = null; - + ContextActionPanel.getInstance().updateRegisterButton(); + if (model.isAttributeListChanged()) { + RegisterContextAction register = RegisterContextAction.getInstance(); + if (register != null) { + register.setEnabled(true); + } + ContextDataPanel.getInstance().resetDateAndIDField(); + } final String msg = Messages.getLogMessage("ADD_SELECTED_CONTEXT_ATTRIBUTES_ACTION_OK"); LOGGER.debug(msg); diff --git a/src/main/java/fr/soleil/bensikin/actions/context/RemoveSelectedContextAttributesAction.java b/src/main/java/fr/soleil/bensikin/actions/context/RemoveSelectedContextAttributesAction.java index 5cb13e2aa2aff47c1c4f8846c842ad5269a74ce5..f5f926f4c87245f5914722b4f5aade0e870bb7b0 100644 --- a/src/main/java/fr/soleil/bensikin/actions/context/RemoveSelectedContextAttributesAction.java +++ b/src/main/java/fr/soleil/bensikin/actions/context/RemoveSelectedContextAttributesAction.java @@ -42,6 +42,7 @@ import javax.swing.tree.TreePath; import fr.soleil.bensikin.actions.BensikinAction; import fr.soleil.bensikin.components.context.detail.ContextAttributesTree; import fr.soleil.bensikin.containers.context.ContextActionPanel; +import fr.soleil.bensikin.containers.context.ContextDataPanel; import fr.soleil.bensikin.models.ContextAttributesTreeModel; /** @@ -83,6 +84,14 @@ public class RemoveSelectedContextAttributesAction extends BensikinAction { ContextAttributesTree.getInstance().expandAll(true); } } + ContextActionPanel.getInstance().updateRegisterButton(); + if (model.isAttributeListChanged()) { + RegisterContextAction register = RegisterContextAction.getInstance(); + if (register != null) { + register.setEnabled(true); + } + ContextDataPanel.getInstance().resetDateAndIDField(); + } ContextActionPanel.getInstance().allowPrint(false); } } diff --git a/src/main/java/fr/soleil/bensikin/actions/context/ValidateAlternateSelectionAction.java b/src/main/java/fr/soleil/bensikin/actions/context/ValidateAlternateSelectionAction.java index dc5db258c15edc40ae79317dcdf447c74b82c52a..9b603bfb853b4ba6e0a2c32c9ab4d3341a8c0a72 100644 --- a/src/main/java/fr/soleil/bensikin/actions/context/ValidateAlternateSelectionAction.java +++ b/src/main/java/fr/soleil/bensikin/actions/context/ValidateAlternateSelectionAction.java @@ -39,6 +39,8 @@ import javax.swing.Action; import fr.soleil.archiving.tango.entity.Attribute; import fr.soleil.bensikin.actions.BensikinAction; +import fr.soleil.bensikin.containers.context.ContextActionPanel; +import fr.soleil.bensikin.containers.context.ContextDataPanel; import fr.soleil.bensikin.containers.context.ContextDetailPanel; import fr.soleil.bensikin.data.context.Context; import fr.soleil.bensikin.data.context.ContextAttribute; @@ -103,6 +105,14 @@ public class ValidateAlternateSelectionAction extends BensikinAction { if ((currentContext != null) && (currentContext.getContextAttributes() != null)) { currentContext.getContextAttributes().removeAttributesNotInList(attrs); } + ContextActionPanel.getInstance().updateRegisterButton(); + if (treeModel.isAttributeListChanged()) { + RegisterContextAction register = RegisterContextAction.getInstance(); + if (register != null) { + register.setEnabled(true); + } + ContextDataPanel.getInstance().resetDateAndIDField(); + } } } } diff --git a/src/main/java/fr/soleil/bensikin/actions/listeners/SelectedContextListener.java b/src/main/java/fr/soleil/bensikin/actions/listeners/SelectedContextListener.java index d2403fd4c1d94e533cf67942cd4a40fed55ddefb..9ba7e830fffe346247e41960435f1624e72d09ae 100644 --- a/src/main/java/fr/soleil/bensikin/actions/listeners/SelectedContextListener.java +++ b/src/main/java/fr/soleil/bensikin/actions/listeners/SelectedContextListener.java @@ -38,7 +38,6 @@ import fr.soleil.bensikin.actions.context.LaunchSnapshotAction; import fr.soleil.bensikin.actions.context.MatchContextAttributesAction; import fr.soleil.bensikin.actions.context.RegisterContextAction; import fr.soleil.bensikin.actions.snapshot.FilterSnapshotsAction; -import fr.soleil.bensikin.containers.context.ContextDataPanel; import fr.soleil.bensikin.data.context.Context; /** @@ -69,11 +68,6 @@ public class SelectedContextListener implements PropertyChangeListener { if (id == null || id.trim().isEmpty()) { launchSnapshotAction.setEnabled(false); filterSnapshotsAction.setEnabled(false); - - ContextDataPanel contextDataPanel = ContextDataPanel.getInstance(); - registerContextAction.setEnabled(contextDataPanel.isEnabled()); - - // --CLA added 23/09/05 for loaded contexts registerContextAction.setEnabled(true); // --CLA 16/11/05 diff --git a/src/main/java/fr/soleil/bensikin/components/BensikinMenuBar.java b/src/main/java/fr/soleil/bensikin/components/BensikinMenuBar.java index 1eb92fb8d4696383d63a5bf67bbbe0ac29b286ee..b6c0279b528ce4129a7fed6852780b5ee0df8d3f 100644 --- a/src/main/java/fr/soleil/bensikin/components/BensikinMenuBar.java +++ b/src/main/java/fr/soleil/bensikin/components/BensikinMenuBar.java @@ -68,14 +68,11 @@ import fr.soleil.bensikin.tools.Messages; */ public class BensikinMenuBar extends JMenuBar { - private static final long serialVersionUID = -2323144122924232321L; + private static final long serialVersionUID = -5736854712009150182L; private static BensikinMenuBar instance = null; - // private JMenuItem favorites_contexts_add; - // private JMenuItem favorites_snapshots; - // private JMenuItem favorites_config; - private JMenu favorites_contexts; + private JMenu favoritesContexts; private final JMenu favoritesMenu; private final JMenuItem contextsMenu_register; @@ -100,7 +97,6 @@ public class BensikinMenuBar extends JMenuBar { String msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT_AS"); contextsMenu_register.setText(msg); contextsMenu_register.setToolTipText(msg); - // RegisterContextAction.getInstance().setEnabled(false); } /** @@ -110,14 +106,12 @@ public class BensikinMenuBar extends JMenuBar { String msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT"); contextsMenu_register.setText(msg); contextsMenu_register.setToolTipText(msg); - // RegisterContextAction.getInstance().setEnabled(false); } /** * Builds the MenuBar */ private BensikinMenuBar() { - // System.out.println ( "BensikinMenuBar/repere 1" ); String fileLabel = Messages.getMessage("MENU_FILE"); String contextsLabel = Messages.getMessage("MENU_CONTEXTS"); String snapshotsLabel = Messages.getMessage("MENU_SNAPSHOTS"); @@ -131,19 +125,15 @@ public class BensikinMenuBar extends JMenuBar { String saveAsLabel = Messages.getMessage("MENU_SAVE_AS"); String saveAllLabel = Messages.getMessage("MENU_SAVE_ALL"); String importLabel = Messages.getMessage("MENU_IMPORT"); - // String exportLabel = Messages.getMessage( "MENU_EXPORT" ); String recentLabel = Messages.getMessage("MENU_RECENT"); String configurationLabel = Messages.getMessage("MENU_CONFIGURATION"); String openLabel = Messages.getMessage("MENU_OPEN"); - // String quickLoadLabel = Messages.getMessage( "MENU_QUICK_LOAD" ); String dbLabel = Messages.getMessage("MENU_DB"); String configurationsLabel = Messages.getMessage("MENU_CONFIGURATIONS"); String optionsLabel = Messages.getMessage("MENU_OPTIONS"); String contentsLabel = Messages.getMessage("MENU_CONTENTS"); String tipsLabel = Messages.getMessage("MENU_TIPS"); String aboutLabel = Messages.getMessage("MENU_ABOUT"); - // String launchSnapshotLabel = Messages.getMessage( - // "MENU_LAUNCH_SNAPSHOT" ); String addContextToFavoritesLabel = Messages.getMessage("MENU_FAVORITES_ADD_CONTEXT"); String exitLabel = Messages.getMessage("MENU_EXIT"); @@ -223,11 +213,6 @@ public class BensikinMenuBar extends JMenuBar { LoadContextAction loadContextAction = new LoadContextAction(fileLabel, false); JMenuItem contextsMenu_open_file = new JMenuItem(loadContextAction); - // LoadContextAction quickLoadContextAction = new LoadContextAction( - // quickLoadLabel , true ); - // JMenuItem contextsMenu_quick_load = new JMenuItem( - // quickLoadContextAction ); - contextsMenu_open_file.setEnabled(true); JMenuItem contextsMenu_open_db = new JMenuItem(new OpenSearchContextsAction("DB")); JMenuItem contextsMenu_open_recent = new JMenuItem(recentLabel); @@ -239,8 +224,6 @@ public class BensikinMenuBar extends JMenuBar { JMenuItem contextsMenu_save = new JMenuItem(new SaveSelectedContextAction(saveLabel, false)); contextsMenu_register = new JMenuItem(RegisterContextAction.getInstance()); - // JMenuItem contextsMenu_save_file = new JMenuItem( fileLabel ); - // JMenuItem contextsMenu_save_db = new JMenuItem( dbLabel ); JMenuItem contextsMenu_saveAs = new JMenuItem(new SaveSelectedContextAction(saveAsLabel, true)); @@ -248,7 +231,6 @@ public class BensikinMenuBar extends JMenuBar { contextsMenu.add(contextsMenu_save); contextsMenu.add(contextsMenu_saveAs); contextsMenu.add(contextsMenu_open); - // contextsMenu.add( contextsMenu_quick_load ); contextsMenu.addSeparator(); contextsMenu.add(contextsMenu_register); @@ -260,16 +242,8 @@ public class BensikinMenuBar extends JMenuBar { LoadSnapshotAction loadSnapshotAction = new LoadSnapshotAction(fileLabel, false); JMenuItem snapshotsMenu_open_file = new JMenuItem(loadSnapshotAction); - /* - * LoadSnapshotAction quickLoadSnapshotAction = new LoadSnapshotAction( - * quickLoadLabel , true ); JMenuItem snapshotsMenu_quick_load = new - * JMenuItem( quickLoadSnapshotAction ); - */ - JMenuItem snapshotsMenu_open_db = new JMenuItem(FilterSnapshotsAction.getInstance(dbLabel)); snapshotsMenu_open_db.setName(dbLabel); - // JMenuItem snapshotsMenu_open_recent = new JMenuItem( recentLabel ); - snapshotsMenu_open.add(snapshotsMenu_open_file); snapshotsMenu_open.add(snapshotsMenu_open_db); JMenuItem snapshotsMenu_new = new JMenuItem(LaunchSnapshotAction.getInstance(newLabel)); @@ -277,15 +251,9 @@ public class BensikinMenuBar extends JMenuBar { JMenuItem snapshotsMenu_save = new JMenuItem(new SaveSelectedSnapshotAction(saveLabel, null, false)); JMenuItem snapshotsMenu_saveAs = new JMenuItem(new SaveSelectedSnapshotAction(saveAsLabel, null, true)); - // LaunchSnapshotAction launchSnapshotAction = - // LaunchSnapshotAction.getInstance( launchSnapshotLabel ); - // JMenuItem snapshotsMenu_launchSnapshot = new JMenuItem( - // launchSnapshotAction ); - snapshotsMenu.add(snapshotsMenu_save); snapshotsMenu.add(snapshotsMenu_saveAs); snapshotsMenu.add(snapshotsMenu_open); - // snapshotsMenu.add( snapshotsMenu_quick_load ); snapshotsMenu.addSeparator(); snapshotsMenu.add(snapshotsMenu_new); // BEGIN Snapshots Menu @@ -303,11 +271,11 @@ public class BensikinMenuBar extends JMenuBar { Favorites favorites = Favorites.getInstance(); if (favorites != null && favorites.getContextSubMenu() != null) { - favorites_contexts = favorites.getContextSubMenu().getMenuRoot(); + favoritesContexts = favorites.getContextSubMenu().getMenuRoot(); favoritesMenu.add(favorites_contexts_add); favoritesMenu.addSeparator(); - favoritesMenu.add(favorites_contexts); + favoritesMenu.add(favoritesContexts); } // BEGIN Favorites Menu @@ -341,12 +309,11 @@ public class BensikinMenuBar extends JMenuBar { } /** - * @param _favorites_contexts - * The favorites_contexts to set. + * @param favoritesContexts The favoritesContexts to set. */ - public void setFavorites_contexts(JMenu _favorites_contexts) { - favoritesMenu.remove(favorites_contexts); - this.favorites_contexts = _favorites_contexts; - favoritesMenu.add(favorites_contexts); + public void setFavorites_contexts(JMenu favoritesContexts) { + favoritesMenu.remove(favoritesContexts); + this.favoritesContexts = favoritesContexts; + favoritesMenu.add(favoritesContexts); } } diff --git a/src/main/java/fr/soleil/bensikin/containers/context/ContextActionPanel.java b/src/main/java/fr/soleil/bensikin/containers/context/ContextActionPanel.java index 4c56e9e3c8a345a8883bd2ba5ee3b36ab9c59495..a735fc3b2004305fabf2774b252e8b9988a8478c 100644 --- a/src/main/java/fr/soleil/bensikin/containers/context/ContextActionPanel.java +++ b/src/main/java/fr/soleil/bensikin/containers/context/ContextActionPanel.java @@ -41,7 +41,6 @@ package fr.soleil.bensikin.containers.context; import java.awt.Font; -import java.awt.Insets; import javax.swing.Box; import javax.swing.BoxLayout; @@ -55,7 +54,11 @@ import fr.soleil.bensikin.actions.context.ContextDetailPrintChooseAction; import fr.soleil.bensikin.actions.context.LaunchSnapshotAction; import fr.soleil.bensikin.actions.context.RegisterContextAction; import fr.soleil.bensikin.actions.context.SaveSelectedContextAction; +import fr.soleil.bensikin.components.context.detail.ContextAttributesTree; +import fr.soleil.bensikin.models.ContextAttributesTreeModel; import fr.soleil.bensikin.tools.Messages; +import fr.soleil.comete.swing.util.CometeUtils; +import fr.soleil.lib.project.ObjectUtils; /** * Contains the buttons used to launch actions on the current context. @@ -64,16 +67,19 @@ import fr.soleil.bensikin.tools.Messages; */ public class ContextActionPanel extends JPanel { - private static final long serialVersionUID = -2158074338581647391L; - private final ImageIcon registerIcon = new ImageIcon(Bensikin.class.getResource("icons/register.gif")); - private final ImageIcon launchIcon = new ImageIcon(Bensikin.class.getResource("icons/launch.gif")); - private final ImageIcon quickSaveIcon = new ImageIcon(Bensikin.class.getResource("icons/quick_save.gif")); - private final ImageIcon printIcon = new ImageIcon(Bensikin.class.getResource("icons/print.gif")); + private static final long serialVersionUID = -6324717904753618814L; + + private static final ImageIcon REGISTER_ICON = new ImageIcon(Bensikin.class.getResource("icons/register.gif")); + private static final ImageIcon LAUNCH_ICON = new ImageIcon(Bensikin.class.getResource("icons/launch.gif")); + private static final ImageIcon QUICK_SAVE_ICON = new ImageIcon(Bensikin.class.getResource("icons/quick_save.gif")); + private static final ImageIcon PRINT_ICON = new ImageIcon(Bensikin.class.getResource("icons/print.gif")); + private static final Font BUTTON_FONT = new Font("Arial", Font.PLAIN, 11); private static ContextActionPanel contextActionPanelInstance = null; + private final LaunchSnapshotAction launchSnapshotAction; private final JButton registerContextButton; private final JButton printContextButton; - private ContextDetailPrintChooseAction printAction = null; + private ContextDetailPrintChooseAction printAction; /** * Instantiates itself if necessary, returns the instance. @@ -81,128 +87,109 @@ public class ContextActionPanel extends JPanel { * @return The instance */ public static ContextActionPanel getInstance() { - if (contextActionPanelInstance == null) { - contextActionPanelInstance = new ContextActionPanel(); - } + if (contextActionPanelInstance == null) { + contextActionPanelInstance = new ContextActionPanel(); + } + return contextActionPanelInstance; + } - return contextActionPanelInstance; + /** + * Builds the panel + */ + private ContextActionPanel() { + super(); + setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); + String msg; + + msg = Messages.getMessage("CONTEXT_DETAIL_PRINT_TITLE"); + printAction = new ContextDetailPrintChooseAction(msg); + + printContextButton = new JButton(printAction); + printContextButton.setIcon(PRINT_ICON); + printContextButton.setMargin(CometeUtils.getzInset()); + printContextButton.setText(ObjectUtils.EMPTY_STRING); + printContextButton.setToolTipText(msg); + GUIUtilities.setObjectBackground(printContextButton, GUIUtilities.CONTEXT_CLIPBOARD_COLOR); + + msg = Messages.getMessage("CONTEXT_DETAIL_LAUNCH_SNAPSHOT"); + launchSnapshotAction = LaunchSnapshotAction.getInstance(msg); + JButton launchSnapshotButton = new JButton(launchSnapshotAction); + // Be sure to have the expected text, and not the one from the BensikinMenuBar + launchSnapshotButton.setText(msg); + launchSnapshotButton.setIcon(LAUNCH_ICON); + launchSnapshotButton.setMargin(CometeUtils.getzInset()); + launchSnapshotButton.setFocusable(false); + launchSnapshotButton.setFocusPainted(false); + launchSnapshotButton.setFont(BUTTON_FONT); + GUIUtilities.setObjectBackground(launchSnapshotButton, GUIUtilities.CONTEXT_COLOR); + + msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT"); + RegisterContextAction registerContextAction = RegisterContextAction.getInstance(msg); + registerContextButton = new JButton(registerContextAction); + registerContextButton.setIcon(REGISTER_ICON); + registerContextButton.setMargin(CometeUtils.getzInset()); + registerContextButton.setFocusable(false); + registerContextButton.setFocusPainted(false); + registerContextButton.setFont(BUTTON_FONT); + GUIUtilities.setObjectBackground(registerContextButton, GUIUtilities.CONTEXT_COLOR); + + msg = Messages.getMessage("CONTEXT_DETAIL_SAVE_CONTEXT"); + SaveSelectedContextAction saveSnapshotAction = new SaveSelectedContextAction(msg, true); + JButton saveSnapshotButton = new JButton(saveSnapshotAction); + saveSnapshotButton.setIcon(QUICK_SAVE_ICON); + saveSnapshotButton.setMargin(CometeUtils.getzInset()); + saveSnapshotButton.setFocusable(false); + saveSnapshotButton.setFocusPainted(false); + saveSnapshotButton.setFont(BUTTON_FONT); + GUIUtilities.setObjectBackground(saveSnapshotButton, GUIUtilities.CONTEXT_COLOR); + + add(Box.createHorizontalGlue()); + add(printContextButton); + add(Box.createHorizontalGlue()); + add(registerContextButton); + add(Box.createHorizontalGlue()); + add(launchSnapshotButton); + add(Box.createHorizontalGlue()); + + GUIUtilities.setObjectBackground(this, GUIUtilities.CONTEXT_COLOR); } /** * Updates the text of the "register" button */ public void updateRegisterButton() { - String msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT_AS"); - registerContextButton.setText(msg); - // registerContextButton.setToolTipText( msg ); - // RegisterContextAction.getInstance().setEnabled(false); + boolean changed = false; + ContextAttributesTree tree = ContextAttributesTree.getInstance(); + if (tree != null) { + ContextAttributesTreeModel model = (ContextAttributesTreeModel) tree.getModel(); + changed = (model != null) && model.isAttributeListChanged(); + } + String msg = Messages + .getMessage(changed ? "CONTEXT_DETAIL_REGISTER_CONTEXT" : "CONTEXT_DETAIL_REGISTER_CONTEXT_AS"); + registerContextButton.setText(msg); } /** * Resets the text of the "register" button to the default text */ public void resetRegisterButton() { - String msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT"); - registerContextButton.setText(msg); - // registerContextButton.setToolTipText( msg ); - // RegisterContextAction.getInstance().setEnabled(false); - } - - /** - * Builds the panel - */ - private ContextActionPanel() { - super(); - this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); - String msg; - Font font = new Font("Arial", Font.PLAIN, 11); - - msg = Messages.getMessage("CONTEXT_DETAIL_PRINT_TITLE"); - printAction = new ContextDetailPrintChooseAction(msg); - - printContextButton = new JButton(printAction); - printContextButton.setIcon(printIcon); - printContextButton.setMargin(new Insets(0, 0, 0, 0)); - printContextButton.setText(""); - printContextButton.setToolTipText(msg); - GUIUtilities.setObjectBackground(printContextButton, GUIUtilities.CONTEXT_CLIPBOARD_COLOR); - - msg = Messages.getMessage("CONTEXT_DETAIL_LAUNCH_SNAPSHOT"); - launchSnapshotAction = LaunchSnapshotAction.getInstance(msg); - JButton launchSnapshotButton = new JButton(launchSnapshotAction); - // Be sure to have the expected text, and not the one from the - // BensikinMenuBar - launchSnapshotButton.setText(msg); - launchSnapshotButton.setIcon(launchIcon); - // launchSnapshotButton.setPreferredSize(new Dimension(140, 20)); - launchSnapshotButton.setMargin(new Insets(0, 0, 0, 0)); - launchSnapshotButton.setFocusable(false); - launchSnapshotButton.setFocusPainted(false); - launchSnapshotButton.setFont(font); - GUIUtilities.setObjectBackground(launchSnapshotButton, GUIUtilities.CONTEXT_COLOR); - - msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT"); - RegisterContextAction registerContextAction = RegisterContextAction.getInstance(msg); - registerContextButton = new JButton(registerContextAction); - registerContextButton.setIcon(registerIcon); - // registerContextButton.setPreferredSize(new Dimension(83, 20)); - registerContextButton.setMargin(new Insets(0, 0, 0, 0)); - registerContextButton.setFocusable(false); - registerContextButton.setFocusPainted(false); - registerContextButton.setFont(font); - GUIUtilities.setObjectBackground(registerContextButton, GUIUtilities.CONTEXT_COLOR); - - msg = Messages.getMessage("CONTEXT_DETAIL_SAVE_CONTEXT"); - SaveSelectedContextAction saveSnapshotAction = new SaveSelectedContextAction(msg, true); - JButton saveSnapshotButton = new JButton(saveSnapshotAction); - saveSnapshotButton.setIcon(quickSaveIcon); - // saveSnapshotButton.setPreferredSize(new Dimension(120, 20)); - saveSnapshotButton.setMargin(new Insets(0, 0, 0, 0)); - saveSnapshotButton.setFocusable(false); - saveSnapshotButton.setFocusPainted(false); - saveSnapshotButton.setFont(font); - GUIUtilities.setObjectBackground(saveSnapshotButton, GUIUtilities.CONTEXT_COLOR); - - // msg = Messages.getMessage( "CONTEXT_DETAIL_ACTIONS" ); - // JLabel actionsLabel = new JLabel( msg , SwingConstants.RIGHT ); - - this.add(Box.createHorizontalGlue()); - this.add(printContextButton); - this.add(Box.createHorizontalGlue()); - this.add(registerContextButton); - this.add(Box.createHorizontalGlue()); - this.add(launchSnapshotButton); - this.add(Box.createHorizontalGlue()); - // this.add( saveSnapshotButton ); - - // this.setMaximumSize( new Dimension( Integer.MAX_VALUE , 60 ) ); - - GUIUtilities.setObjectBackground(this, GUIUtilities.CONTEXT_COLOR); - // msg = - // Messages.getMessage("CONTEXT_DETAIL_ATTRIBUTES_ALTERNATE_TITLE"); - /* - * TitledBorder tb = BorderFactory.createTitledBorder(BorderFactory - * .createEtchedBorder(EtchedBorder.LOWERED), msg, - * TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.TOP, - * GUIUtilities.getTitleFont()); this.setBorder(tb); - */ - - // GUIUtilities.addDebugBorderToPanel ( this , true , Color.GREEN , 1 ); + String msg = Messages.getMessage("CONTEXT_DETAIL_REGISTER_CONTEXT"); + registerContextButton.setText(msg); } /** * Calls the printAction */ public void openPrintDialog() { - if (printAction != null) { - printAction.actionPerformed(null); - } + if (printAction != null) { + printAction.actionPerformed(null); + } } public void allowPrint(boolean allowed) { - if (printAction != null) { - printAction.setEnabled(allowed); - } + if (printAction != null) { + printAction.setEnabled(allowed); + } } } diff --git a/src/main/java/fr/soleil/bensikin/containers/context/ContextDataPanel.java b/src/main/java/fr/soleil/bensikin/containers/context/ContextDataPanel.java index 3f5a7226267a42a102c6ea1b217bb6a6e9de827a..677f37706673e11a9bd592523093a4253011bfcf 100644 --- a/src/main/java/fr/soleil/bensikin/containers/context/ContextDataPanel.java +++ b/src/main/java/fr/soleil/bensikin/containers/context/ContextDataPanel.java @@ -68,7 +68,7 @@ import fr.soleil.lib.project.ObjectUtils; */ public class ContextDataPanel extends JPanel { - private static final long serialVersionUID = 5752827912756103034L; + private static final long serialVersionUID = -6041004612752309656L; private static final String BULLET = "(*) "; private static final Color DARK_RED = new Color(150, 0, 0); @@ -396,13 +396,18 @@ public class ContextDataPanel extends JPanel { * 29 juin 2005 */ public void resetFields() { - creationDateField.setText(ObjectUtils.EMPTY_STRING); nameField.setText(ObjectUtils.EMPTY_STRING); authorNameField.setText(ObjectUtils.EMPTY_STRING); reasonField.setText(ObjectUtils.EMPTY_STRING); descriptionField.setText(ObjectUtils.EMPTY_STRING); attributeCountField.setText(ObjectUtils.EMPTY_STRING); idField.setText(ObjectUtils.EMPTY_STRING); + resetDateAndIDField(); + } + + public void resetDateAndIDField() { + creationDateField.setText(ObjectUtils.EMPTY_STRING); + idField.setText(ObjectUtils.EMPTY_STRING); } /** diff --git a/src/main/java/fr/soleil/bensikin/data/context/Context.java b/src/main/java/fr/soleil/bensikin/data/context/Context.java index 49133483a036e3964156cc3c99dc8a56430f0a23..1d17a46b288214bfefbad818721aa77db6d67d58 100644 --- a/src/main/java/fr/soleil/bensikin/data/context/Context.java +++ b/src/main/java/fr/soleil/bensikin/data/context/Context.java @@ -189,7 +189,7 @@ public class Context implements Comparable<Context> { throw new SnapshotingException(Messages.getLogMessage("LOAD_CONTEXT_ATTRIBUTES_KO")); } else { final AttributeHeavy[] sah = source.findContextAttributes(cont, searchCriterions); - this.setContextAttributes(sah); + setContextAttributes(sah); } } @@ -266,30 +266,24 @@ public class Context implements Comparable<Context> { * @param sah The attributes to convert */ private void setContextAttributes(final AttributeHeavy[] sah) { - if (sah == null) { - return; - } - - final int numberOfAttributes = sah.length; - final ContextAttributes _contextAttributes = new ContextAttributes(this); - final ContextAttribute[] tab = new ContextAttribute[numberOfAttributes]; - - for (int i = 0; i < numberOfAttributes; i++) { - final AttributeHeavy currentInAttribute = sah[i]; - final ContextAttribute currentOutAttribute = new ContextAttribute(_contextAttributes); - - currentOutAttribute.setName(currentInAttribute.getAttribute_name()); - currentOutAttribute.setCompleteName(currentInAttribute.getAttributeCompleteName()); - currentOutAttribute.setDevice(currentInAttribute.getAttribute_device_name()); - currentOutAttribute.setDomain(currentInAttribute.getDomain()); - currentOutAttribute.setFamily(currentInAttribute.getFamily()); - currentOutAttribute.setMember(currentInAttribute.getMember()); - - tab[i] = currentOutAttribute; + if (sah != null) { + final int numberOfAttributes = sah.length; + final ContextAttributes contextAttributes = new ContextAttributes(this); + final ContextAttribute[] tab = new ContextAttribute[numberOfAttributes]; + for (int i = 0; i < numberOfAttributes; i++) { + final AttributeHeavy currentInAttribute = sah[i]; + final ContextAttribute currentOutAttribute = new ContextAttribute(contextAttributes); + currentOutAttribute.setName(currentInAttribute.getAttribute_name()); + currentOutAttribute.setCompleteName(currentInAttribute.getAttributeCompleteName()); + currentOutAttribute.setDevice(currentInAttribute.getAttribute_device_name()); + currentOutAttribute.setDomain(currentInAttribute.getDomain()); + currentOutAttribute.setFamily(currentInAttribute.getFamily()); + currentOutAttribute.setMember(currentInAttribute.getMember()); + tab[i] = currentOutAttribute; + } + contextAttributes.setContextAttributes(tab); + setContextAttributes(contextAttributes); } - - _contextAttributes.setContextAttributes(tab); - this.setContextAttributes(_contextAttributes); } /** @@ -302,7 +296,6 @@ public class Context implements Comparable<Context> { if (contextData == null) { contextData = ContextDataManager.getInstance().getContextData(contextId); } - if (contextData != null) { val.setAuthor_name(contextData.getAuthorName()); val.setCreation_date(contextData.getCreationDate()); @@ -311,7 +304,6 @@ public class Context implements Comparable<Context> { val.setName(contextData.getName()); val.setReason(contextData.getReason()); } - return val; } @@ -340,18 +332,17 @@ public class Context implements Comparable<Context> { final ISnapManager source = SnapManagerFactory.getCurrentImpl(); final SnapContext[] requestResult = source.findContexts(searchCriterions); - + final ContextData[] ret; if (requestResult == null) { - return null; - } - - final int numberOfLines = requestResult.length; - final ContextData[] ret = new ContextData[numberOfLines]; + ret = null; + } else { + final int numberOfLines = requestResult.length; + ret = new ContextData[numberOfLines]; - for (int i = 0; i < numberOfLines; i++) { - ret[i] = new ContextData(requestResult[i]); + for (int i = 0; i < numberOfLines; i++) { + ret[i] = new ContextData(requestResult[i]); + } } - return ret; } @@ -732,9 +723,6 @@ public class Context implements Comparable<Context> { * @return */ public static Context buildContextToBeSaved() { - // System.out.println ( - // "Context/buildContextToBeSaved IN/"+Context.getSelectedContext().getPath()+"/" - // ); final ContextDataPanel contextDataPanel = ContextDataPanel.getInstance(); final String id_s = contextDataPanel.getIDField().getText(); final String creationDate_s = contextDataPanel.getCreationDateField().getText(); @@ -742,33 +730,14 @@ public class Context implements Comparable<Context> { final String author = contextDataPanel.getAuthorNameField().getText(); final String reason = contextDataPanel.getReasonField().getText(); final String description = contextDataPanel.getDescriptionField().getText(); - - // System.out.println ( - // "Context/buildContextToBeSaved IN 1/"+Context.getSelectedContext().getPath()+"/" - // ); - final ContextAttributesTreeModel model = ContextAttributesTreeModel.getInstance(false); - - // System.out.println ( - // "Context/buildContextToBeSaved IN 2/"+Context.getSelectedContext().getPath()+"/" - // ); - final Context ret = Context.fillContext(id_s, creationDate_s, name, author, reason, description, model); - - // System.out.println ( - // "Context/buildContextToBeSaved IN 3/"+Context.getSelectedContext().getPath()+"/" - // ); if (Context.getSelectedContext() != null) { Context.getSelectedContext().setContextAttributes(ret.getContextAttributes()); ret.getContextData().setPath(Context.getSelectedContext().getPath()); Context.getSelectedContext().setContextData(ret.getContextData()); Context.getSelectedContext().setModified(ret.isModified()); } - - // System.out.println ( - // "Context/buildContextToBeSaved OUT/"+Context.getSelectedContext().getPath()+"/" - // ); - return Context.getSelectedContext(); } @@ -777,51 +746,30 @@ public class Context implements Comparable<Context> { * @param b */ public void save(final IContextManager manager, final boolean saveAs) { - // System.out.println ( - // "Context/save BEFORE/"+Context.getSelectedContext().getPath()+"/" ); final String pathToUse = getPathToUse(manager, saveAs); - if (pathToUse == null) { - return; - } - // System.out.println ( - // "Context/save/pathToUse/"+pathToUse+"/saveAs/"+saveAs+"/" ); - manager.setNonDefaultSaveLocation(pathToUse); - try { - final Context newContext = new Context(getContextId()); - final ContextData newData = new ContextData(contextData.getId(), contextData.getCreationDate(), - contextData.getName(), contextData.getAuthorName(), contextData.getReason(), - contextData.getDescription()); - newContext.setContextData(newData); - newContext.setContextAttributes(getContextAttributes()); - newContext.setSnapshots(getSnapshots()); - newContext.setPath(pathToUse); - newContext.setModified(false); - // manager.saveArchivingConfiguration( this , null ); - manager.saveContext(newContext); - Context.setSelectedContext(newContext); - - // System.out.println ( - // "Context/save AFTER/"+Context.getSelectedContext().getPath()+"/" - // ); - - final String msg = Messages.getLogMessage("SAVE_CONTEXT_ACTION_OK"); - LOGGER.debug(msg); - } catch (final Exception e) { - final String msg = Messages.getLogMessage("SAVE_CONTEXT_ACTION_KO"); - LOGGER.error(msg, e); - - setPath(null); - setModified(true); - - return; + if (pathToUse != null) { + manager.setNonDefaultSaveLocation(pathToUse); + try { + final Context newContext = new Context(getContextId()); + final ContextData newData = new ContextData(contextData.getId(), contextData.getCreationDate(), + contextData.getName(), contextData.getAuthorName(), contextData.getReason(), + contextData.getDescription()); + newContext.setContextData(newData); + newContext.setContextAttributes(getContextAttributes()); + newContext.setSnapshots(getSnapshots()); + newContext.setPath(pathToUse); + newContext.setModified(false); + manager.saveContext(newContext); + Context.setSelectedContext(newContext); + final String msg = Messages.getLogMessage("SAVE_CONTEXT_ACTION_OK"); + LOGGER.debug(msg); + } catch (final Exception e) { + final String msg = Messages.getLogMessage("SAVE_CONTEXT_ACTION_KO"); + LOGGER.error(msg, e); + setPath(null); + setModified(true); + } } - - // ----WARNING!!!!!!!!!!!!!!!!!!!!! - /* - * ArchivingGeneralPanel panel = ArchivingGeneralPanel.getInstance(); - * panel.setPath( this.getPath() ); - */ - // ----WARNING!!!!!!!!!!!!!!!!!!!!! } /** @@ -830,8 +778,6 @@ public class Context implements Comparable<Context> { private String getPathToUse(final IContextManager manager, final boolean saveAs) { String path = null; final String pathToUse = getPath(); - // System.out.println ( - // "Context/getPathToUse/pathToUse/"+pathToUse+"/saveAs/"+saveAs+"/" ); final JFileChooser chooser = new JFileChooser(); final ContextFileFilter ACfilter = new ContextFileFilter(); chooser.addChoosableFileFilter(ACfilter); @@ -929,8 +875,8 @@ public class Context implements Comparable<Context> { return contextId; } - public void setContextId(final int _contextId) { - contextId = _contextId; + public void setContextId(final int contextId) { + this.contextId = contextId; } public void setContextFile(final boolean isContextFile) { diff --git a/src/main/java/fr/soleil/bensikin/data/context/ContextData.java b/src/main/java/fr/soleil/bensikin/data/context/ContextData.java index 8fb217f85119d05a7e20667517966eb30db03bf6..a07f08f0099272f352840cd12c73172da5e0b577 100644 --- a/src/main/java/fr/soleil/bensikin/data/context/ContextData.java +++ b/src/main/java/fr/soleil/bensikin/data/context/ContextData.java @@ -46,7 +46,8 @@ import fr.soleil.lib.project.ObjectUtils; * @author CLAISSE */ public class ContextData implements Comparable<ContextData> { - public final static int COLUMNS_COUNT = 6; + + public static final int COLUMNS_COUNT = 6; private int id; private Date creationDate = null; @@ -98,32 +99,32 @@ public class ContextData implements Comparable<ContextData> { * @param source */ public ContextData(final SnapContext source) { - this.setAuthorName(source.getAuthor_name()); - this.setCreationDate(source.getCreation_date()); - this.setDescription(source.getDescription()); - this.setId(source.getId()); - this.setName(source.getName()); - this.setReason(source.getReason()); + setAuthorName(source.getAuthor_name()); + setCreationDate(source.getCreation_date()); + setDescription(source.getDescription()); + setId(source.getId()); + setName(source.getName()); + setReason(source.getReason()); } /** * Builds a ContextData from parameters * - * @param _id - * @param _creation_date - * @param _name - * @param _author_name - * @param _reason - * @param _description + * @param id + * @param creation_date + * @param name + * @param authorName + * @param reason + * @param description */ - public ContextData(final int _id, final Date _creation_date, final String _name, final String _author_name, - final String _reason, final String _description) { - this.id = _id; - this.creationDate = _creation_date; - this.name = _name; - this.authorName = _author_name; - this.reason = _reason; - this.description = _description; + public ContextData(final int id, final Date creation_date, final String name, final String authorName, + final String reason, final String description) { + this.id = id; + this.creationDate = creation_date; + this.name = name; + this.authorName = authorName; + this.reason = reason; + this.description = description; } /** @@ -139,33 +140,32 @@ public class ContextData implements Comparable<ContextData> { ContextDataPanel contextDataPanel = ContextDataPanel.getInstance(); JTextField timeField = contextDataPanel.getCreationDateField(); - String creation_date_s = this.getCreationDate() == null ? ObjectUtils.EMPTY_STRING - : this.getCreationDate().toString(); + String creation_date_s = getCreationDate() == null ? ObjectUtils.EMPTY_STRING : getCreationDate().toString(); timeField.setText(creation_date_s); JTextField nameField = contextDataPanel.getNameField(); - if (!nameField.getText().equals(this.getName())) { - nameField.setText(this.getName()); + if (!nameField.getText().equals(getName())) { + nameField.setText(getName()); } JTextField authorField = contextDataPanel.getAuthorNameField(); - if (!authorField.getText().equals(this.getAuthorName())) { - authorField.setText(this.getAuthorName()); + if (!authorField.getText().equals(getAuthorName())) { + authorField.setText(getAuthorName()); } JTextField reasonField = contextDataPanel.getReasonField(); - if (!reasonField.getText().equals(this.getReason())) { - reasonField.setText(this.getReason()); + if (!reasonField.getText().equals(getReason())) { + reasonField.setText(getReason()); } JTextField descriptionField = contextDataPanel.getDescriptionField(); - if (!descriptionField.getText().equals(this.getName())) { - descriptionField.setText(this.getDescription()); + if (!descriptionField.getText().equals(getName())) { + descriptionField.setText(getDescription()); } // Update ID at end to ensure SelectedContextListener disables "register context" action (TANGOARCH-629) IDTextField idField = contextDataPanel.getIDField(); - String id_s = this.getId() == -1 ? ObjectUtils.EMPTY_STRING : String.valueOf(this.getId()); + String id_s = getId() == -1 ? ObjectUtils.EMPTY_STRING : String.valueOf(getId()); idField.setText(id_s); BensikinMenuBar.getInstance().updateRegisterItem(); diff --git a/src/main/java/fr/soleil/bensikin/models/ContextAttributesTreeModel.java b/src/main/java/fr/soleil/bensikin/models/ContextAttributesTreeModel.java index dbce6c26af1b043d70de3537325c035affeba367..aa134659273f433d3fde78acb1443132a396c7e6 100644 --- a/src/main/java/fr/soleil/bensikin/models/ContextAttributesTreeModel.java +++ b/src/main/java/fr/soleil/bensikin/models/ContextAttributesTreeModel.java @@ -46,7 +46,6 @@ package fr.soleil.bensikin.models; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.TreeMap; @@ -61,6 +60,7 @@ import fr.soleil.archiving.tango.entity.model.AttributesSelectTableModel; import fr.soleil.bensikin.comparators.BensikinToStringObjectComparator; import fr.soleil.bensikin.components.context.detail.ContextAttributesTree; import fr.soleil.bensikin.components.context.detail.PossibleAttributesTree; +import fr.soleil.bensikin.containers.context.ContextActionPanel; import fr.soleil.bensikin.containers.context.ContextDetailPanel; import fr.soleil.bensikin.data.context.ContextAttribute; import fr.soleil.lib.project.ObjectUtils; @@ -128,7 +128,7 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { AttributesSelectTableModel attributesSelectTableModel = ContextDetailPanel.getInstance() .getAttributeTableSelectionBean().getSelectionPanel().getAttributesSelectTable().getModel(); - List<TreePath> paths = new ArrayList<TreePath>(); + List<TreePath> paths = new ArrayList<>(); TreeMap<String, ContextAttribute> possibleAttr = null; try { @@ -147,26 +147,26 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { Object currentPathObject = aPath.getPathComponent(depth); if (depth == 0) { - currentTreeObject = (DefaultMutableTreeNode) this.getRoot(); + currentTreeObject = (DefaultMutableTreeNode) getRoot(); continue; } - int numOfChildren = this.getChildCount(currentTreeObject); - List<String> vect = new ArrayList<String>(); + int numOfChildren = getChildCount(currentTreeObject); + List<String> vect = new ArrayList<>(); for (int childIndex = 0; childIndex < numOfChildren; childIndex++) { - Object childAt = this.getChild(currentTreeObject, childIndex); + Object childAt = getChild(currentTreeObject, childIndex); vect.add(childAt.toString()); } if (vect.contains(currentPathObject.toString())) { int pos = vect.indexOf(currentPathObject.toString()); - currentTreeObject = (DefaultMutableTreeNode) this.getChild(currentTreeObject, pos); + currentTreeObject = (DefaultMutableTreeNode) getChild(currentTreeObject, pos); } else { vect.add(currentPathObject.toString()); Collections.sort(vect, new BensikinToStringObjectComparator()); DefaultMutableTreeNode newChild = new DefaultMutableTreeNode(currentPathObject.toString()); int index = vect.indexOf(currentPathObject.toString()); - this.insertNodeInto(newChild, currentTreeObject, index); + insertNodeInto(newChild, currentTreeObject, index); paths.add(new TreePath(newChild.getPath())); @@ -223,26 +223,26 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { Object currentPathObject = aPath.getPathComponent(depth); if (depth == 0) { - currentTreeObject = (DefaultMutableTreeNode) this.getRoot(); + currentTreeObject = (DefaultMutableTreeNode) getRoot(); continue; } - int numOfChildren = this.getChildCount(currentTreeObject); + int numOfChildren = getChildCount(currentTreeObject); List<String> vect = new ArrayList<>(); for (int childIndex = 0; childIndex < numOfChildren; childIndex++) { - Object childAt = this.getChild(currentTreeObject, childIndex); + Object childAt = getChild(currentTreeObject, childIndex); vect.add(childAt.toString()); } if (vect.contains(currentPathObject.toString())) { int pos = vect.indexOf(currentPathObject.toString()); - currentTreeObject = (DefaultMutableTreeNode) this.getChild(currentTreeObject, pos); + currentTreeObject = (DefaultMutableTreeNode) getChild(currentTreeObject, pos); } else { vect.add(currentPathObject.toString()); Collections.sort(vect, new BensikinToStringObjectComparator()); DefaultMutableTreeNode newChild = new DefaultMutableTreeNode(currentPathObject.toString()); int index = vect.indexOf(currentPathObject.toString()); - this.insertNodeInto(newChild, currentTreeObject, index); + insertNodeInto(newChild, currentTreeObject, index); if (depth == CONTEXT_TREE_DEPTH - 1) { TreeNode[] path = newChild.getPath(); @@ -291,16 +291,12 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { + GUIUtilities.TANGO_DELIM + aPath.getPathComponent(3) + GUIUtilities.TANGO_DELIM + aPath.getPathComponent(4); - /* - * ContextAttribute contextAttribute = this.getAttribute ( key ); - * attributesSelectTableModel.r - */ // to do global remove if (getAttributes().remove(key) != null) { attributeListChanged = true; } try { - this.removeNodeFromParent(node); + removeNodeFromParent(node); } catch (Exception e) { // do nothing } @@ -316,6 +312,7 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { public void build(List<Domain> domains) { super.build(domains); attributeListChanged = false; + ContextActionPanel.getInstance().updateRegisterButton(); } @Override @@ -344,17 +341,14 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { String userObjectRef = (String) aPath.getPathComponent(depth); if (depth == 0) { - currentTreeObject = (DefaultMutableTreeNode) this.getRoot(); + currentTreeObject = (DefaultMutableTreeNode) getRoot(); continue; } - int numOfChildren = this.getChildCount(currentTreeObject); - // List vect = new ArrayList(); + int numOfChildren = getChildCount(currentTreeObject); for (int childIndex = 0; childIndex < numOfChildren; childIndex++) { - DefaultMutableTreeNode childAt = (DefaultMutableTreeNode) this.getChild(currentTreeObject, - childIndex); + DefaultMutableTreeNode childAt = (DefaultMutableTreeNode) getChild(currentTreeObject, childIndex); String userObjectAt = (String) childAt.getUserObject(); - if (userObjectRef.equals(userObjectAt)) { currentTreeObject = childAt; break; @@ -363,23 +357,11 @@ public class ContextAttributesTreeModel extends AttributesTreeModel { } TreeNode[] path = currentTreeObject.getPath(); - this.removeNodeFromParent(currentTreeObject); - - // System.out.println ( "path"+path.length ); - - Iterator<String> it = this.getAttributes().keySet().iterator(); - while (it.hasNext()) { - /* String next = ( String ) */it.next(); - // System.out.println ( "xxx/next 1|"+next+"|" ); - } + removeNodeFromParent(currentTreeObject); - // System.out.println ( "before/"+this.getAttributes - // ().size()+"/translatePathIntoKey ( path )|"+translatePathIntoKey - // ( path )+"|" ); if (getAttributes().remove(translatePathIntoKey(path)) != null) { attributeListChanged = true; } - // System.out.println ( "after/"+this.getAttributes ().size() ); } } } diff --git a/src/main/resources/fr/soleil/bensikin/resources/messages/resources_en_US.properties b/src/main/resources/fr/soleil/bensikin/resources/messages/resources_en_US.properties index 7810f42bd9eada905b6e254bb4ae697394b95c36..7e44e924bde21b278621e5e8136231d6c693f71d 100644 --- a/src/main/resources/fr/soleil/bensikin/resources/messages/resources_en_US.properties +++ b/src/main/resources/fr/soleil/bensikin/resources/messages/resources_en_US.properties @@ -18,7 +18,7 @@ CONTEXT_BORDER = Contexts #-------------------Context detail START--------------- CONTEXT_DETAIL_LAUNCH_SNAPSHOT = Launch snapshot -CONTEXT_DETAIL_REGISTER_CONTEXT = Register this New Context +CONTEXT_DETAIL_REGISTER_CONTEXT = Register as NEW Context CONTEXT_DETAIL_REGISTER_CONTEXT_AS = Register this Context CONTEXT_DETAIL_SAVE_CONTEXT = Quick save CONTEXT_DETAIL_ACTIONS = Actions :