Ticket #2402: auto-actions.3.patch

File auto-actions.3.patch, 323.7 KB (added by tanya, 15 years ago)
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/dummies/helpers/DummyBookHelper.java

    ### Eclipse Workspace Patch 1.0
    #P sophie
     
    2323import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    2424import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    2525import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     26import org.sophie2.base.skins.Message; 
    2627 
    2728/** 
    2829 * Dummy helper for the {@link DummyBook}. 
     
    3233public class DummyBookHelper extends ResourceH { 
    3334 
    3435        /** 
     36         * Constant created for creating new page. 
     37         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     38         * Used for skinning. Used in the test. 
     39         */ 
     40        public static final String CREATE_NEW_PAGE = "Create new page"; 
     41 
     42        /** 
    3543         * Constructs the helper with an access  
    3644         *  
    3745         * @param access 
     
    113121 
    114122                final ResourceRefList pages = book.get(DummyBook.KEY_PAGES); 
    115123                 
    116                 new AutoAction("Create new page", true) { 
     124                new AutoAction(Message.create(CREATE_NEW_PAGE), true) { 
    117125                        @Override 
    118126                        public void performAuto() { 
    119127                                DummyBookHelper.addNewPage(getChanger(), pageRef, pages); 
  • modules/org.sophie2.main.func.media/src/main/java/org/sophie2/main/func/media/logic/MediaLogic.java

     
    44import org.sophie2.base.media.MediaState; 
    55import org.sophie2.base.media.TimePos; 
    66import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     7import org.sophie2.base.skins.Message; 
    78import org.sophie2.base.visual.interaction.InputEventR3; 
    89import org.sophie2.core.logging.SophieLog; 
    910import org.sophie2.core.modularity.SortKey; 
     
    6465                        final TimePos viewTime = view.getTime(); 
    6566                        final TimePos endTime =  view.model().get().getTimelineOptions().advance(viewTime, duration); 
    6667                        // Incorrect (see the previous line)- new TimePos(viewTime.getPhase(), viewTime.getMillis() + duration); 
    67                         new AutoAction("Play/Pause", true) { 
     68                        new AutoAction(Message.create(PLAY_PAUSE), true) { 
    6869                                @Override 
    6970                                public void performAuto() { 
    7071                                        MediaStateChannel newChannel; 
     
    107108                        final MediaStateChannel oldChannel = view.model().get().get( 
    108109                                        MediaFrameR4.KEY_STATE); 
    109110 
    110                         new AutoAction("Stop", true) { 
     111                        new AutoAction(Message.create(STOP), true) { 
    111112 
    112113                                @Override 
    113114                                public void performAuto() { 
     
    158159        }; 
    159160 
    160161        /** 
     162         * Constant created for seek. 
     163         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     164         * Used for skinning. 
     165         */ 
     166        public static final String SEEK = "Seek"; 
     167         
     168        /** 
     169         * Constant created for stop. 
     170         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     171         * Used for skinning. 
     172         */ 
     173        public static final String STOP = "Stop"; 
     174 
     175        /** 
     176         * Constant created for play/pause. 
     177         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     178         * Used for skinning. 
     179         */ 
     180        public static final String PLAY_PAUSE = "Play/Pause"; 
     181 
     182        /** 
    161183         * Handles the events coming from the SeekMediaManipulationView. 
    162184         *  
    163185         * @param event 
     
    205227                final MediaStateChannel oldChannel = view.model().get().get( 
    206228                                MediaFrameR4.KEY_STATE); 
    207229 
    208                 new AutoAction("Seek", true) { 
     230                new AutoAction(Message.create(SEEK), true) { 
    209231 
    210232                        @Override 
    211233                        public void performAuto() { 
  • modules/org.sophie2.main.func.timelines/src/main/java/org/sophie2/main/func/timelines/links/PlayingActionLogic.java

     
    55import org.sophie2.base.model.book.links.LinkAction; 
    66import org.sophie2.base.model.book.resource.r4.BookR4; 
    77import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     8import org.sophie2.base.skins.Message; 
    89import org.sophie2.core.mvc.EventFilterBuilder; 
    910import org.sophie2.core.mvc.OperationDef; 
    1011import org.sophie2.core.mvc.events.EventR3; 
     
    3738                        BookView bookView = event.getSource(BookView.class); 
    3839                        BookH book = bookView.model().get(); 
    3940 
    40                         new AutoAction("Play timelines.", true) { 
     41                        new AutoAction(Message.create(PLAY_TIMELINES), true) { 
    4142                                @Override 
    4243                                public void performAuto() { 
    4344                                        getChanger().setRaw(BookR4.KEY_PLAY_TIMELINES, true); 
     
    6667 
    6768                        bookView.setTime(TimePos.MAIN_START); 
    6869 
    69                         new AutoAction("Stop timelines.", true) { 
     70                        new AutoAction(Message.create(STOP_TIMELINES), true) { 
    7071                                @Override 
    7172                                public void performAuto() { 
    7273                                        getChanger().setRaw(BookR4.KEY_PLAY_TIMELINES, false); 
     
    113114                        BookView bookView = event.getSource(BookView.class); 
    114115                        BookH book = bookView.model().get(); 
    115116 
    116                         new AutoAction("Pause timelines.", true) { 
     117                        new AutoAction(Message.create(PAUSE_TIMELINES), true) { 
    117118                                @Override 
    118119                                public void performAuto() { 
    119120                                        getChanger().setRaw(BookR4.KEY_PLAY_TIMELINES, false); 
     
    123124                        return true; 
    124125                } 
    125126        }; 
     127 
     128        /** 
     129         * Constant created for pause timelines. 
     130         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     131         * Used for skinning. 
     132         */ 
     133        public static final String PAUSE_TIMELINES = "Pause timelines."; 
     134         
     135        /** 
     136         * Constant created for stop timelines. 
     137         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     138         * Used for skinning. 
     139         */ 
     140        public static final String STOP_TIMELINES = "Stop timelines."; 
     141         
     142        /** 
     143         * Constant created for play timelines.. 
     144         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     145         * Used for skinning. 
     146         */ 
     147        public static final String PLAY_TIMELINES = "Play timelines."; 
    126148} 
     149 No newline at end of file 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/AppearanceHud.java

     
    4444import org.sophie2.base.model.resources.r4.keys.CompositeKey; 
    4545import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    4646import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     47import org.sophie2.base.skins.Message; 
    4748import org.sophie2.base.skins.SkinElementId; 
    4849import org.sophie2.base.visual.BaseSwingVisualElement; 
    4950import org.sophie2.base.visual.BaseVisualElement; 
     
    791792                                        return false; 
    792793                                } 
    793794 
    794                                 new AutoAction("Change frame background opacity", true) { 
     795                                new AutoAction(Message.create(BG_OPACITY), true) { 
    795796                                        @Override 
    796797                                        public void performAuto() { 
    797798                                                getChanger().setRaw(StyledElement.KEY_BACKGROUND__OPACITY, 
     
    823824                                String inputData = event.getEventParam(EventIds.INPUT_PARAM_INDEX, String.class); 
    824825                                final Float input = BoundValidation.parseNumber(inputData, Float.class); 
    825826 
    826                                 new AutoAction("Change border size.", true) { 
     827                                new AutoAction(Message.create(BORDER_SIZE), true) { 
    827828                                        @Override 
    828829                                        public void performAuto() { 
    829830                                                getChanger().setRaw(StyledElement.KEY_BORDER__INSETS, new ImmInsets(input)); 
     
    856857                                final ImmColor input = event.getEventParam( 
    857858                                                ColorPickerHudField.EventIds.COLOR_PARAM_INDEX, ImmColor.class); 
    858859 
    859                                 new AutoAction("Change frame border color", true) { 
     860                                new AutoAction(Message.create(BORDER_COLOR), true) { 
    860861                                        @Override 
    861862                                        public void performAuto() { 
    862863                                                getChanger().setRaw(StyledElement.KEY_BORDER__COLOR, input); 
     
    886887                                final Boolean input = event 
    887888                                .getEventParam(EventIds.INPUT_PARAM_INDEX, Boolean.class); 
    888889 
    889                                 new AutoAction("Toggle shadow enabled.", true) { 
     890                                new AutoAction(Message.create(SHADOW_ENABLED), true) { 
    890891                                        @Override 
    891892                                        public void performAuto() { 
    892893                                                getChanger().setRaw(FrameR4.KEY_SHADOW__ENABLED, input); 
     
    918919                                String inputData = event.getEventParam(EventIds.INPUT_PARAM_INDEX, String.class); 
    919920                                final Float input = BoundValidation.parseNumber(inputData, Float.class); 
    920921 
    921                                 new AutoAction("Change shadow offset.", true) { 
     922                                new AutoAction(Message.create(SHADOW_OFFSET), true) { 
    922923                                        @Override 
    923924                                        public void performAuto() { 
    924925                                                getChanger().setRaw(FrameR4.KEY_SHADOW__POSITION, 
     
    948949                                ComboInput<BackgroundType> input = event.getEventParam( 
    949950                                                BoundControl.EventIds.INPUT_PARAM_INDEX, ComboInput.class); 
    950951                                final BackgroundType type = input.getSelectedItem(); 
    951                                 new AutoAction("Set background type.", true) { 
     952                                new AutoAction(Message.create(BG_TYPE), true) { 
    952953                                        @Override 
    953954                                        public void performAuto() { 
    954955                                                getChanger().setRaw(StyledElement.KEY_BACKGROUND__TYPE, type); 
     
    984985                                final VisibleChannel channel = ElementR4.KEY_VISIBLE.get(access); 
    985986                                final TimePos time = fv.getTime(); 
    986987 
    987                                 new AutoAction("Toggle frame visibility.", true) { 
     988                                new AutoAction(Message.create(FRAME_VISIBILITY), true) { 
    988989                                        @Override 
    989990                                        public void performAuto() { 
    990991                                                getChanger().setRaw(ElementR4.KEY_VISIBLE, channel.setValue(time, input)); 
     
    10091010                                ResourceAccess access = getAccess(source); 
    10101011                                final Boolean input = event.getEventParam(BoundControl.EventIds.INPUT_PARAM_INDEX, 
    10111012                                                Boolean.class); 
    1012                                 new AutoAction("Toggle shadow enabled.", true) { 
     1013                                new AutoAction(Message.create(SHADOW_ENABLED), true) { 
    10131014                                        @Override 
    10141015                                        public void performAuto() { 
    10151016                                                getChanger().setRaw(FrameR4.KEY_SHADOW__ENABLED, input); 
     
    10381039                                final WrappingModes input = comboInput.getSelectedItem(); 
    10391040                                 
    10401041                                if (!input.equals(FrameR4.KEY_WRAP.get(access))) {  
    1041                                         new AutoAction("Change wrap mode.", true) {  
     1042                                        new AutoAction(Message.create(WRAP_MODE), true) {  
    10421043                                                @Override  
    10431044                                                public void performAuto() {  
    10441045                                                        getChanger().setRaw(FrameR4.KEY_WRAP, input);  
     
    10671068         *            The {@link TemplatedKey} used to access the value. 
    10681069         */ 
    10691070        protected static void setBorderInsetsComponent(Side side, String input, 
    1070                         String eventDescription, ResourceAccess access, final TemplatedKey<ImmInsets> key) { 
     1071                        Message eventDescription, ResourceAccess access, final TemplatedKey<ImmInsets> key) { 
    10711072                ImmInsets insets = key.get(access); 
    10721073                float value = BoundValidation.parseNumber(input, Float.class); 
    10731074                final ImmInsets newInsets = insets.setSide(side, value); 
     
    10871088         * @param key 
    10881089         *            The {@link TemplatedKey} used to access the value. 
    10891090         */ 
    1090         protected static void setBorderInsets(final ImmInsets insets, String eventDescription, 
     1091        protected static void setBorderInsets(final ImmInsets insets, Message eventDescription, 
    10911092                        ResourceAccess access, final TemplatedKey<ImmInsets> key) { 
    10921093                new AutoAction(eventDescription, true) { 
    10931094                        @Override 
     
    11421143                Mode templateMode = key.getMode(access); 
    11431144                return templateMode == mode; 
    11441145        } 
     1146         
     1147        /** 
     1148         * Constant created for changing background opacity. 
     1149         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1150         * Used for skinning. 
     1151         */ 
     1152        public static final String BG_OPACITY = "Change background opacity"; 
     1153         
     1154        /** 
     1155         * Constant created for changing border size. 
     1156         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1157         * Used for skinning. 
     1158         */ 
     1159        public static final String BORDER_SIZE = "Change border size."; 
     1160         
     1161        /** 
     1162         * Constant created for changing border color. 
     1163         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1164         * Used for skinning. 
     1165         */ 
     1166        public static final String BORDER_COLOR = "Change border color"; 
     1167         
     1168        /** 
     1169         * Constant created for toggling shadow enable. 
     1170         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1171         * Used for skinning. 
     1172         */ 
     1173        public static final String SHADOW_ENABLED = "Toggle shadow enabled."; 
     1174         
     1175        /** 
     1176         * Constant created for setting background type. 
     1177         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1178         * Used for skinning. 
     1179         */ 
     1180        public static final String BG_TYPE = "Set background type."; 
     1181         
     1182        /** 
     1183         * Constant created for changing shadow offset. 
     1184         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1185         * Used for skinning. 
     1186         */ 
     1187        public static final String SHADOW_OFFSET = "Change shadow offset."; 
     1188         
     1189        /** 
     1190         * Constant created for toggling frame visibility. 
     1191         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1192         * Used for skinning. 
     1193         */ 
     1194        public static final String FRAME_VISIBILITY = "Toggle frame visibility."; 
     1195         
     1196        /** 
     1197         * Constant created for changing wrap mode. 
     1198         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1199         * Used for skinning. 
     1200         */ 
     1201        public static final String WRAP_MODE = "Change wrap mode."; 
    11451202} 
     1203 No newline at end of file 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/keys/TemplatingTest.java

     
    1515import org.sophie2.base.model.resources.r4.dummies.resources.DummyResource; 
    1616import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
    1717import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.core.modularity.FakeModuleRegistry; 
    1920import org.sophie2.core.prolib.impl.AutoProperty; 
    2021import org.sophie2.core.prolib.impl.BaseProObject; 
     
    2930public class TemplatingTest extends UnitTestBase { 
    3031 
    3132        /** 
     33         * Constant created for fred is a human. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. Used in the test. 
     36         */ 
     37        public static final String FRED_IS_A_HUMAN = "Fred is a human!!!"; 
     38         
     39        /** 
     40         * Constant created for dino is a dog. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. Used in the test. 
     43         */ 
     44        public static final String DINO_IS_A_DOG = "Dino is a dog!!!"; 
     45 
     46        /** 
     47         * Constant created for locking dino. 
     48         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     49         * Used for skinning. Used in the test. 
     50         */ 
     51        public static final String LOCKING_DINO = "Locking Dino"; 
     52         
     53        /** 
     54         * Constant created for setting barny to fred's friend.  
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. Used in the test. 
     57         */ 
     58        public static final String SETTING_BARNY_TO_FRED_FRIEND = "Setting Barny to Fred's friend"; 
     59         
     60        /** 
     61         * Constant created for making dummy. 
     62         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     63         * Used for skinning. Used in the test. 
     64         */ 
     65        public static final String MAKING_DUMMY = "making dummy :)"; 
     66 
     67        /** 
    3268         * Testing class used for testing tracking. 
    3369         *  
    3470         * @author meddle, deni 
     
    80116                ResourceRefR4 ref = ResourceRefR4.make(LocationPrefix.NULL + "Templated res"); 
    81117                this.access = MasterTestAccess.make("some-view", ref); 
    82118                 
    83                 new AutoAction("making dummy :)", true) { 
     119                new AutoAction(Message.create(MAKING_DUMMY), true) { 
    84120                        @Override 
    85121                        public void performAuto() { 
    86122                                getChanger().setRaw(ResourceR4.KEY_KIND, DummyResource.KIND); 
     
    116152                assertSame(Mode.USE_TEMPLATE, templatedMode);    
    117153                 
    118154                // Set a child to be custom: 
    119                 new AutoAction("Setting Barny to Fred's friend", true) { 
     155                new AutoAction(Message.create(SETTING_BARNY_TO_FRED_FRIEND), true) { 
    120156                        @Override 
    121157                        public void performAuto() { 
    122158                                getChanger().setRaw(DummyResource.KEY_BARNY, "Fred's friend"); 
     
    127163                assertSame(Mode.CUSTOM, templatedMode); 
    128164                 
    129165                // Set to use template again: 
    130                 new AutoAction("Setting Barny to Fred's friend", true) { 
     166                new AutoAction(Message.create(SETTING_BARNY_TO_FRED_FRIEND), true) { 
    131167                        @Override 
    132168                        public void performAuto() { 
    133169                                getChanger().setRaw(DummyResource.KEY_BARNY, null); 
     
    138174                assertSame(Mode.USE_TEMPLATE, templatedMode); 
    139175                 
    140176                // Lock one key: 
    141                 new AutoAction("Locking Dino", true) { 
     177                new AutoAction(Message.create(LOCKING_DINO), true) { 
    142178                        @Override 
    143179                        public void performAuto() { 
    144180                                getChanger().setRaw(DummyResource.KEY_DINO.getLockKey(), true); 
     
    150186                assertSame(Mode.CUSTOM, templatedMode); 
    151187                 
    152188                // Lock all keys: 
    153                 new AutoAction("Locking Dino", true) { 
     189                new AutoAction(Message.create(LOCKING_DINO), true) { 
    154190                        @Override 
    155191                        public void performAuto() { 
    156192                                getChanger().setRaw(DummyResource.KEY_BARNY.getLockKey(), true); 
     
    163199                assertSame(Mode.LOCKED, templatedMode); 
    164200                 
    165201                // Set the composite key to 'USE TEMPLATE' mode 
    166                 new AutoAction("Locking Dino", true) { 
     202                new AutoAction(Message.create(LOCKING_DINO), true) { 
    167203                        @Override 
    168204                        public void performAuto() { 
    169205                                getChanger().setRaw(DummyResource.KEY_BARNY.getLockKey(), false); 
     
    192228                assertEquals((Integer) 0, tracker.counter().get()); 
    193229                 
    194230                // Change the composite key's child value: 
    195                 new AutoAction("Dino is a dog!!!", true) { 
     231                new AutoAction(Message.create(DINO_IS_A_DOG), true) { 
    196232                        @Override 
    197233                        public void performAuto() { 
    198234                                getChanger().setRaw(DummyResource.KEY_DINO, "I'm a dog!"); 
     
    202238                assertEquals((Integer) 1, tracker.counter().get()); 
    203239                 
    204240                // Change the composite key's value: 
    205                 new AutoAction("Dino is a dog!!!", true) { 
     241                new AutoAction(Message.create(DINO_IS_A_DOG), true) { 
    206242                        @Override 
    207243                        public void performAuto() { 
    208244                                getChanger().setRaw(DummyResource.KEY_TEMP_COMPOSITE, null); 
     
    211247                 
    212248                assertEquals((Integer) 2, tracker.counter().get()); 
    213249                 
    214                 new AutoAction("Dino is a dog!!!", true) { 
     250                new AutoAction(Message.create(DINO_IS_A_DOG), true) { 
    215251                        @Override 
    216252                        public void performAuto() { 
    217253                                getChanger().setRaw(DummyResource.KEY_DINO, "I'm a dog again!"); 
     
    220256                 
    221257                assertEquals((Integer) 3, tracker.counter().get()); 
    222258                 
    223                 new AutoAction("Fred is a human!!!", true) { 
     259                new AutoAction(Message.create(FRED_IS_A_HUMAN), true) { 
    224260                        @Override 
    225261                        public void performAuto() { 
    226262                                getChanger().setRaw(DummyResource.KEY_FRED, "I'm human!"); 
  • modules/org.sophie2.main.app.menus/src/test/java/org/sophie2/main/app/menus/UndoRedoTest.java

     
    2424import org.sophie2.base.natlib.BaseNatlibModule; 
    2525import org.sophie2.base.scene.BaseSceneModule; 
    2626import org.sophie2.base.skins.BaseSkinsModule; 
     27import org.sophie2.base.skins.Message; 
    2728import org.sophie2.base.visual.BaseVisualModule; 
    2829import org.sophie2.core.logging.LogLevel; 
    2930import org.sophie2.core.logging.SophieLog; 
     
    4849 */ 
    4950public class UndoRedoTest extends AppTestBase { 
    5051 
     52        /** 
     53         * Constant created for one significant change. 
     54         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     55         * Used for skinning. Used in the test. 
     56         */ 
     57        public static final String ONE_SIGNIFICANT_CHANGE = "One significant change."; 
     58         
     59        /** 
     60         * Constant created for end of group changes. 
     61         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     62         * Used for skinning. Used in the test. 
     63         */ 
     64        public static final String END_OF_GROUP_CHANGES = "End of group changes"; 
     65         
     66        /** 
     67         * Constant created for insignificant group change. 
     68         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     69         * Used for skinning. Used in the test. 
     70         */ 
     71        public static final String INSIGNIFICANT_GROUP_CHANGE = "Unsignificant group change."; 
    5172        private AppMainWindow mainWindow; 
    5273 
    5374        @SuppressWarnings("unchecked") 
     
    234255 
    235256        private <T> void registerChage(ResourceAccess access, final Key<T> key,  
    236257                        final T value) { 
    237                 new AutoAction("Unsignificant group change.", false) { 
     258                new AutoAction(Message.create(INSIGNIFICANT_GROUP_CHANGE), false) { 
    238259                        @Override 
    239260                        public void performAuto() { 
    240261                                getChanger().setRaw(key, value); 
     
    244265        } 
    245266 
    246267        private void registerEndChage(ResourceAccess access) { 
    247                 new AutoAction("End of group changes", true) { 
     268                new AutoAction(Message.create(END_OF_GROUP_CHANGES), true) { 
    248269                        @Override 
    249270                        public void performAuto() { 
    250271                                //nothing to change 
     
    266287                } 
    267288                registerEndChage(this.firstAccess); 
    268289                 
    269                 new AutoAction("One significant change.", true) { 
     290                new AutoAction(Message.create(ONE_SIGNIFICANT_CHANGE), true) { 
    270291                        @Override 
    271292                        public void performAuto() { 
    272293                                getChanger().setRaw(ResourceR4.KEY_COMMENT, "Comment."); 
  • modules/org.sophie2.base.skins/src/test/java/org/sophie2/base/skins/MessageTest.java

     
     1package org.sophie2.base.skins; 
     2 
     3import java.util.HashMap; 
     4import java.util.Map; 
     5 
     6import org.sophie2.core.testing.ImmutabilityTestBase; 
     7 
     8/** 
     9 *      Tests the immutability of a message object. 
     10 *  
     11 * @author tanya 
     12 */ 
     13public class MessageTest extends ImmutabilityTestBase<Message> { 
     14 
     15        @Override 
     16        protected Map<Class<?>, Object> constructorArgs() throws Exception { 
     17                Map<Class<?>, Object> args = new HashMap<Class<?>, Object>(); 
     18                 
     19                return args; 
     20        } 
     21 
     22        @Override 
     23        protected Message createImmutableEqualToObj1() throws Exception { 
     24                return Message.create("Size changed from %1$s to %2$s", 10, 20); 
     25        } 
     26 
     27        @Override 
     28        protected Message createImmutableObj1() throws Exception { 
     29                return Message.create("Size changed from %1$s to %2$s", 10, 20); 
     30        } 
     31 
     32        @Override 
     33        protected Map<Class<?>, Object> methodArgs() throws Exception { 
     34                Map<Class<?>, Object> args = new HashMap<Class<?>, Object>(); 
     35                 
     36                return args; 
     37        } 
     38 
     39} 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/changes/Change.java

     
    22 
    33import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    44import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
     5import org.sophie2.base.skins.Message; 
    56import org.sophie2.core.prolib.annot.Immutable; 
    67 
    78/** 
     
    1718         
    1819        private final ResourceRefR4 user; 
    1920        private final String viewId; 
    20         private final String description; 
     21        private final Message description; 
    2122        private final boolean significant; 
    2223         
    2324        /** 
     
    3536         *                      If the new <code>Change</code> is significant. 
    3637         */ 
    3738        public Change(ResourceRefR4 user, 
    38                         String viewId, String description, boolean significant) { 
     39                        String viewId, Message description, boolean significant) { 
    3940                this.user = user; 
    4041                this.viewId = viewId; 
    4142                this.description = description; 
     
    7980         *                      The <var>description</var>. 
    8081         */      
    8182        public String getDescription() { 
    82                 return this.description; 
     83                return this.description.getText(); 
    8384        } 
    8485 
    8586        @Override 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/util/CopyPageClipboard.java

     
    44import org.sophie2.base.model.book.PageH; 
    55import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    66import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     7import org.sophie2.base.skins.Message; 
    78import org.sophie2.core.prolib.util.ProUtil; 
    89 
    910/** 
     
    2021 */ 
    2122public class CopyPageClipboard { 
    2223 
     24        /** 
     25         * Constant created for copying a page into a new book.  
     26         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     27         * Used for skinning. 
     28         */ 
     29        public static final String COPY_PAGE_INTO_NEW_BOOK = "Copies a page into a new book"; 
    2330        private PageH copiedPage = null; 
    2431 
    2532        /** 
     
    4653                final ResourceRefR4 targetRef =  
    4754                        ResourceRefR4.makeChild(this.copiedPage.getName()); 
    4855                 
    49                 new AutoAction("Copies a page into a new book", true) { 
     56                new AutoAction(Message.create(COPY_PAGE_INTO_NEW_BOOK), true) { 
    5057                        @Override 
    5158                        public void performAuto() { 
    5259                                getChanger().copyResource(sourceRef, targetRef); 
  • modules/org.sophie2.main.func.servers/src/main/java/org/sophie2/main/func/servers/logic/ServersTabLogic.java

     
    3434import org.sophie2.base.model.resources.r4.model.ResourceModel; 
    3535import org.sophie2.base.model.resources.r4.model.RevisionId; 
    3636import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     37import org.sophie2.base.skins.Message; 
    3738import org.sophie2.core.logging.SophieLog; 
    3839import org.sophie2.core.modularity.SortKey; 
    3940import org.sophie2.core.mvc.EventFilterBuilder; 
     
    296297                                return false; 
    297298                        } 
    298299                         
    299                         new AutoAction("Modify server.", true) { 
     300                        new AutoAction(Message.create(MODIFY_SERVER), true) { 
    300301 
    301302                                @Override 
    302303                                public void performAuto() { 
     
    446447                                return false; 
    447448                        } 
    448449                         
    449                         new AutoAction("Upload " + resourceRef + " to " 
    450                                         + serverResourcesDirectory.getRef() + ".", true) { 
     450                        new AutoAction(Message.create(UPLOAD_RES_TO_SERVER, resourceRef,  
     451                                        serverResourcesDirectory.getRef()), true) { 
    451452                                @Override 
    452453                                public void performAuto() { 
    453454                                        ResourceChanger dirChanger = getChanger(); 
     
    486487        }; 
    487488 
    488489        /** 
     490         * Constant created for uploading a resource (by name of the resource) to server (by name of the server). 
     491         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     492         * Used for skinning. 
     493         */ 
     494        public static final String UPLOAD_RES_TO_SERVER = "Upload %1$s to %2$s."; 
     495         
     496        /** 
     497         * Constant created for modifying of a server. 
     498         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     499         * Used for skinning. 
     500         */ 
     501        public static final String MODIFY_SERVER = "Modify server."; 
     502 
     503        /** 
    489504         * Sets a server account entered by the user in a 
    490505         * dialog. 
    491506         *  
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/properties/PropertiesHud.java

     
    3030import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    3131import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
    3232import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     33import org.sophie2.base.skins.Message; 
    3334import org.sophie2.base.skins.SkinElementId; 
    3435import org.sophie2.base.visual.VisualElement; 
    3536import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    728729 
    729730                                final ImmSize newSize = new ImmSize(width, height); 
    730731 
    731                                 new AutoAction("Set frame width.", true) { 
     732                                new AutoAction(Message.create(SET_FRAME_WIDTH), true) { 
    732733                                        @Override 
    733734                                        public void performAuto() { 
    734735                                                getChanger().setRaw(ResizableElement.KEY_SIZE, newSize); 
     
    763764                                } 
    764765 
    765766                                final ImmSize newSize = new ImmSize(width, height); 
    766                                 new AutoAction("Set frame height.", true) { 
     767                                new AutoAction(Message.create(SET_FRAME_HEIGHT), true) { 
    767768                                        @Override 
    768769                                        public void performAuto() { 
    769770                                                getChanger().setRaw(ResizableElement.KEY_SIZE, newSize); 
     
    840841                                final ImmPoint newPoint = new ImmPoint(value, location.getY()); 
    841842                                final LocationChannel channel = MemberElement.KEY_LOCATION.get(access); 
    842843 
    843                                 new AutoAction("Set X position.", true) { 
     844                                new AutoAction(Message.create(SET_X_POSITION), true) { 
    844845                                        @Override 
    845846                                        public void performAuto() { 
    846847                                                getChanger().setRaw(MemberElement.KEY_LOCATION, channel.setAll(newPoint)); 
     
    871872                                final ImmPoint newPoint = new ImmPoint(location.getValue(getTime(source)).getX(), 
    872873                                                value); 
    873874 
    874                                 new AutoAction("Set Y position.", true) { 
     875                                new AutoAction(Message.create(SET_Y_POSITION), true) { 
    875876                                        @Override 
    876877                                        public void performAuto() { 
    877878                                                getChanger().setRaw(MemberElement.KEY_LOCATION, location.setAll(newPoint)); 
     
    901902 
    902903                                final float value = BoundValidation.parseNumber(input, Float.class); 
    903904 
    904                                 new AutoAction("Set margins.", true) { 
     905                                new AutoAction(Message.create(SET_MARGINS), true) { 
    905906                                        @Override 
    906907                                        public void performAuto() { 
    907908                                                getChanger().setRaw(FrameR4.KEY_MARGIN_INSETS, new ImmInsets(value)); 
     
    931932 
    932933                                final float value = BoundValidation.parseNumber(input, Float.class); 
    933934 
    934                                 new AutoAction("Set padding.", true) { 
     935                                new AutoAction(Message.create(SET_PADDING), true) { 
    935936                                        @Override 
    936937                                        public void performAuto() { 
    937938                                                getChanger().setRaw(FrameR4.KEY_PADDING_INSETS, new ImmInsets(value)); 
     
    959960                                final Double newAngle = Math.toRadians(Double.parseDouble(input)); 
    960961 
    961962                                ResourceAccess access = RotationAngle.getModel(source).getAccess(); 
    962                                 new AutoAction("Set rotation angle", true) { 
     963                                new AutoAction(Message.create(SET_ROTATION_ANGLE), true) { 
    963964 
    964965                                        @Override 
    965966                                        public void performAuto() { 
     
    971972                                return true; 
    972973                        } 
    973974                         
    974                 } 
     975                }; 
     976 
     977                /** 
     978                 * Constant created for setting rotation angle. 
     979                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     980                 * Used for skinning. 
     981                 */ 
     982                public static final String SET_ROTATION_ANGLE = "Set rotation angle"; 
     983                 
     984                /** 
     985                 * Constant created for setting padding. 
     986                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     987                 * Used for skinning. 
     988                 */ 
     989                public static final String SET_PADDING = "Set padding."; 
     990                 
     991                /** 
     992                 * Constant created for setting margins. 
     993                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     994                 * Used for skinning. 
     995                 */ 
     996                public static final String SET_MARGINS = "Set margins."; 
     997                 
     998                /** 
     999                 * Constant created for setting y position. 
     1000                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1001                 * Used for skinning. 
     1002                 */ 
     1003                public static final String SET_Y_POSITION = "Set Y position."; 
     1004                 
     1005                /** 
     1006                 * Constant created for setting x position. 
     1007                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1008                 * Used for skinning. 
     1009                 */ 
     1010                public static final String SET_X_POSITION = "Set X position."; 
     1011                 
     1012                /** 
     1013                 * Constant created for setting frame height. 
     1014                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1015                 * Used for skinning. 
     1016                 */ 
     1017                public static final String SET_FRAME_HEIGHT = "Set frame height."; 
     1018                 
     1019                /** 
     1020                 * Constant created for setting frame width. 
     1021                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     1022                 * Used for skinning. 
     1023                 */ 
     1024                public static final String SET_FRAME_WIDTH = "Set frame width."; 
    9751025        } 
    9761026 
    9771027} 
  • modules/org.sophie2.extra.func.scripting/src/test/java/org/sophie2/extra/func/scripting/facade/JSBookTest.java

     
    1515import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1616import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    1717import org.sophie2.base.skins.BaseSkinsModule; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.base.visual.BaseVisualModule; 
    1920import org.sophie2.core.modularity.SophieModule; 
    2021import org.sophie2.core.mvc.CoreMvcModule; 
     
    3839 */ 
    3940public class JSBookTest extends AppTestBase { 
    4041 
     42        /** 
     43         * Constant created for editing a script. 
     44         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     45         * Used for skinning. Used in the test. 
     46         */ 
     47        public static final String EDIT_SCRIPT = "Edit Script."; 
     48         
     49        /** 
     50         * Constant created for setting title of a book. 
     51         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     52         * Used for skinning. Used in the test. 
     53         */ 
     54        public static final String SET_BOOK_TITLE = "Set book title"; 
     55         
     56        /** 
     57         * Constant created for inserting a script. 
     58         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     59         * Used for skinning. Used in the test. 
     60         */ 
     61        public static final String INSERT_SCRIPT = "Insert script"; 
    4162        private BookH book; 
    4263        private ScriptResourceH script; 
    4364 
     
    5475                final ResourceRefR4 scriptRef =  
    5576                        ResourceRefR4.generateRandomSub(ScriptResourceH.NAME_PREFIX);  
    5677                final ResourceRefR4 bookRef = bookAccess.getRef(); 
    57                 new AutoAction("Insert script", true) { 
     78                new AutoAction(Message.create(INSERT_SCRIPT), true) { 
    5879                         
    5980                        @Override 
    6081                        public void performAuto() { 
     
    132153        public void testNewBook() { 
    133154                final String CURRENT_BOOK_TITLE = "Design Patterns by GoF"; 
    134155                 
    135                 new AutoAction("Set book title", false) { 
     156                new AutoAction(Message.create(SET_BOOK_TITLE), false) { 
    136157                         
    137158                        @Override 
    138159                        public void performAuto() { 
     
    172193                 
    173194                ResourceAccess scriptAccess = this.script.getAccess(); 
    174195                 
    175                 new AutoAction("Edit Script.", true) { 
     196                new AutoAction(Message.create(EDIT_SCRIPT), true) { 
    176197                         
    177198                        @Override 
    178199                        public void performAuto() { 
  • modules/org.sophie2.main.app.commons/src/test/java/org/sophie2/main/app/commons/content/ContentViewTest.java

     
    2020import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2121import org.sophie2.base.scene.interfaces.ImageSceneElement; 
    2222import org.sophie2.base.skins.BaseSkinsModule; 
     23import org.sophie2.base.skins.Message; 
    2324import org.sophie2.base.visual.BaseVisualModule; 
    2425import org.sophie2.core.modularity.FakeModuleRegistry; 
    2526import org.sophie2.core.mvc.CoreMvcModule; 
     
    3334 */ 
    3435public class ContentViewTest extends IntegrationTestBase { 
    3536 
     37        /** 
     38         * Constant created for setting content to null. 
     39         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     40         * Used for skinning. 
     41         */ 
     42        public static final String SET_CONTENT_TO_NULL = "Set content to null"; 
     43         
     44        /** 
     45         * Constant created for setting content. 
     46         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     47         * Used for skinning. 
     48         */ 
     49        public static final String SET_CONTENT = "Set content"; 
     50         
     51        /** 
     52         * Constant created for creating a dummy page. 
     53         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     54         * Used for skinning. 
     55         */ 
     56        public static final String CREATE_DUMMY_FRAME = "Create dummy frame"; 
    3657        private AppLocator locator; 
    3758        private FrameH frame; 
    3859        private DummyResourceH resource; 
     
    6788                final ResourceRefR4 finalResRef = this.resRef; 
    6889                final ResourceRefR4 finalResRef2 = this.resRef2; 
    6990 
    70                 new AutoAction("Create dummy frame", true) { 
     91                new AutoAction(Message.create(CREATE_DUMMY_FRAME), true) { 
    7192 
    7293                        @Override 
    7394                        public void performAuto() { 
     
    115136 
    116137                final ResourceRefR4 ref = this.resRef; 
    117138 
    118                 new AutoAction("Set content", true) { 
     139                new AutoAction(Message.create(SET_CONTENT), true) { 
    119140 
    120141                        @Override 
    121142                        public void performAuto() { 
     
    143164                assertSame(this.frameView.parent().get(), 
    144165                                this.frameView); 
    145166 
    146                 new AutoAction("Set content to null", true) { 
     167                new AutoAction(Message.create(SET_CONTENT_TO_NULL), true) { 
    147168 
    148169                        @Override 
    149170                        public void performAuto() { 
     
    155176 
    156177                assertNull(this.frameView); 
    157178 
    158                 new AutoAction("Set content", true) { 
     179                new AutoAction(Message.create(SET_CONTENT), true) { 
    159180 
    160181                        @Override 
    161182                        public void performAuto() { 
     
    169190                                this.frame); 
    170191 
    171192                final ResourceRefR4 newRef = this.resRef2; 
    172                 new AutoAction("Set content", true) { 
     193                new AutoAction(Message.create(SET_CONTENT), true) { 
    173194 
    174195                        @Override 
    175196                        public void performAuto() { 
  • modules/org.sophie2.dev/src/main/java/org/sophie2/dev/reader/FakeReaderMain.java

     
    3838import org.sophie2.base.persistence.BasePersistenceModule; 
    3939import org.sophie2.base.scene.BaseSceneModule; 
    4040import org.sophie2.base.skins.BaseSkinsModule; 
     41import org.sophie2.base.skins.Message; 
    4142import org.sophie2.base.visual.BaseVisualModule; 
    4243import org.sophie2.core.logging.LogLevel; 
    4344import org.sophie2.core.logging.SophieLog; 
     
    9091public class FakeReaderMain { 
    9192 
    9293        /** 
     94         * Constant created for modifying the developer's book for the reader. 
     95         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     96         * Used for skinning. 
     97         */ 
     98        public static final String MODIFY_THE_DEVELOPER_S_BOOK_FOR_THE_READER = "Modify the developer's book for the reader"; 
     99 
     100        /** 
    93101         * The main method. Instead of running the plugin framework, registers what 
    94102         * should be registered and delegates. Should be invoked with enabled 
    95103         * assertions. 
     
    217225                final String page1Title = ResourceUtil.getNextTitle(book.getRef(), PageR4.DEFAULT_TITLE); 
    218226                final String page2Title = ResourceUtil.getNextTitle(book.getRef(), PageR4.DEFAULT_TITLE); 
    219227 
    220                 new AutoAction("Modify the developer's book for the reader", true) { 
     228                new AutoAction(Message.create(MODIFY_THE_DEVELOPER_S_BOOK_FOR_THE_READER), true) { 
    221229                        @Override 
    222230                        public void performAuto() { 
    223231                                ResourceChanger bookCh = getChanger(); 
  • modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/imports/ResourceImportUtil.java

     
    3535import org.sophie2.base.model.resources.r4.model.ResourceModel; 
    3636import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3737import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     38import org.sophie2.base.skins.Message; 
    3839import org.sophie2.core.logging.SophieLog; 
    3940import org.sophie2.main.app.commons.util.TemplateUtil; 
    4041import org.sophie2.main.dialogs.input.DialogUtils; 
     
    9495                                        ResourceImportType.EMBED); 
    9596 
    9697                // The description must be smarter... May be with skins --meddle 2009-10-21 
    97                 new AutoAction("Import resource " + importInfo.getName() + ".", true) { 
     98                new AutoAction(Message.create(IMPORT_RES, importInfo.getName()), true) { 
    9899                        @Override 
    99100                        public void performAuto() { 
    100101                                ResourceChanger changer = getChanger(); 
     
    134135                final ResourceImportInfo importInfo = new ResourceImportInfo(data, title); 
    135136                final ResourceRefR4 childRef = importManager.generateChildRef(); 
    136137                 
    137                 new AutoAction("Import resource " + importInfo.getName(), significant) { 
     138                new AutoAction(Message.create(IMPORT_RES, importInfo.getName()), significant) { 
    138139                        @Override 
    139140                        public void performAuto() { 
    140141 
     
    145146                 
    146147                return book.getRef().append(childRef); 
    147148        } 
     149         
     150        /** 
     151         * Constant created for importing resources by resource name. 
     152         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     153         * Used for skinning. 
     154         */ 
     155        public final static String IMPORT_RES = "Import resource %1$s."; 
    148156 
    149157        private static <D> void insert(final ResourceImportInfo<D> importInfo, 
    150158                        final ResourceImportManager<D> importManager, BookH book, 
     
    172180 
    173181 
    174182                // The description must be smarter... May be with skins --meddle 2009-10-21 
    175                 new AutoAction("Insert frame for resource " + importInfo.getName() + ".", true) { 
     183                new AutoAction(Message.create(INSERT_FRAME_FOR_RESOURCE, importInfo.getName()), true) { 
    176184                        @Override 
    177185                        public void performAuto() { 
    178186                                ResourceChanger changer = getChanger(); 
     
    201209                        FrameH templateH = ResourceH.getHelper(templateAccess, FrameH.class); 
    202210                        final NaiveImmList<TemplatedKey<?>> immKeys = templateH.getApplicableTemplatedKeys(); 
    203211 
    204                         new AutoAction("Apply template for resource " + importInfo.getName() + ".", false) { 
     212                        new AutoAction(Message.create(APPLY_TEMPLATE_FOR_RESOURCE, importInfo.getName()), false) { 
    205213                                @Override 
    206214                                public void performAuto() { 
    207215                                        TemplateUtil.applyFrameTemplate(getChanger(),  
     
    211219                                } 
    212220                        }.register(frameAccess); 
    213221                } 
    214  
    215222        } 
     223         
     224        /** 
     225         * Constant created for inserting frame for resource by name. 
     226         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     227         * Used for skinning. 
     228         */ 
     229        public static final String INSERT_FRAME_FOR_RESOURCE = "Insert frame for resource %1$s."; 
     230         
     231        /** 
     232         * Constant created for applying template for resource by name. 
     233         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     234         * Used for skinning. 
     235         */ 
     236        public static final String APPLY_TEMPLATE_FOR_RESOURCE = "Apply template for resource %1$s.";  
    216237 
    217238        private static <D> ResourceRefR4 getNewResourceRef( 
    218239                        final ResourceImportInfo<D> importInfo, 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/changes/ChangePersisterTest.java

     
    1717import org.sophie2.base.persistence.persister.MasterPersister; 
    1818import org.sophie2.base.persistence.ref.ValueRef; 
    1919import org.sophie2.base.persistence.storage.Storage; 
     20import org.sophie2.base.skins.Message; 
    2021import org.sophie2.core.modularity.FakeModuleRegistry; 
    2122import org.sophie2.core.testing.TestBase; 
    2223 
     
    2829 */ 
    2930public class ChangePersisterTest extends TestBase { 
    3031 
     32        /** 
     33         * Constant created for testing model change. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. Used in the test. 
     36         */ 
     37        public static final String TEST_MODEL_CHANGE = "Test model change"; 
     38         
     39        /** 
     40         * Constant created for testing auto action. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. Used in the test. 
     43         */ 
     44        public static final String TEST_AUTO_ACTION = "Test auto action"; 
    3145        private static final String SCHEMA = PersistenceUtil.getStorageR3Schema(Change.class); 
    3246 
    3347        @SuppressWarnings("unchecked") 
     
    95109                final ResourceRefR4 childRef = ResourceRefR4.makeChild("childRef"); 
    96110                final ResourceRefList subDirectories = ResourceRefList.EMPTY; 
    97111 
    98                 final AutoAction action = new AutoAction("Test auto action", true) { 
     112                final AutoAction action = new AutoAction(Message.create(TEST_AUTO_ACTION), true) { 
    99113                        @Override 
    100114                        @SuppressWarnings("unused") 
    101115                        public void performAuto() { 
     
    113127                // values = values.add(null); 
    114128                // } 
    115129                ModelChange change = new ModelChange(ResourceRefR4.NONE_REF, ResourceRefR4.NONE_REF, 
    116                                 "test-view-id", "Test model change", true, action.getClass(), values); 
     130                                "test-view-id", Message.create(TEST_MODEL_CHANGE), true, action.getClass(), values); 
    117131                return change; 
    118132        } 
    119133 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/BorderHud.java

     
    1919import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2020import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2121import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     22import org.sophie2.base.skins.Message; 
    2223import org.sophie2.base.skins.SkinElementId; 
    2324import org.sophie2.base.visual.VisualElement; 
    2425import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    332333                                VisualElement source = event.getSource(BorderInsetsTop.class); 
    333334                                String input = event.getEventParam(BoundControl.EventIds.INPUT_PARAM_INDEX, 
    334335                                                String.class); 
    335                                 AppearanceHud.setBorderInsetsComponent(Side.TOP, input, "Set top border size.", 
     336                                AppearanceHud.setBorderInsetsComponent(Side.TOP, input, Message.create(TOP_BORDER_SIZE), 
    336337                                                AppearanceHud.getAccess(source), StyledElement.KEY_BORDER__INSETS); 
    337338                                return true; 
    338339                        } 
     
    355356                                String input = event.getEventParam(BoundControl.EventIds.INPUT_PARAM_INDEX, 
    356357                                                String.class); 
    357358                                 
    358                                 AppearanceHud.setBorderInsetsComponent(Side.RIGHT, input, "Set right border size.", 
     359                                AppearanceHud.setBorderInsetsComponent(Side.RIGHT, input, Message.create(RIGHT_BORDER_SIZE), 
    359360                                                AppearanceHud.getAccess(source), StyledElement.KEY_BORDER__INSETS); 
    360361                                return true; 
    361362                        } 
     
    376377                                VisualElement source = event.getSource(BorderInsetsBottom.class); 
    377378                                String input = event.getEventParam(BoundControl.EventIds.INPUT_PARAM_INDEX, 
    378379                                                String.class); 
    379                                 AppearanceHud.setBorderInsetsComponent(Side.BOTTOM, input, "Set bottom border size.", 
     380                                AppearanceHud.setBorderInsetsComponent(Side.BOTTOM, input, Message.create(BOTTOM_BORDER_SIZE), 
    380381                                                AppearanceHud.getAccess(source), StyledElement.KEY_BORDER__INSETS); 
    381382                                return true; 
    382383                        } 
     
    397398                                VisualElement source = event.getSource(BorderInsetsLeft.class); 
    398399                                String input = event.getEventParam(BoundControl.EventIds.INPUT_PARAM_INDEX, 
    399400                                                String.class); 
    400                                 AppearanceHud.setBorderInsetsComponent(Side.LEFT, input, "Set left border size.", 
     401                                AppearanceHud.setBorderInsetsComponent(Side.LEFT, input, Message.create(LEFT_BORDER_SIZE), 
    401402                                                AppearanceHud.getAccess(source), StyledElement.KEY_BORDER__INSETS); 
    402403                                return true; 
    403404                        } 
     
    433434                                                        borderColor.getBlueValue(),  
    434435                                                        alpha); 
    435436                                         
    436                                         new AutoAction("Change border opacity.", true) { 
     437                                        new AutoAction(Message.create(BORDER_OPACITY), true) { 
    437438                                                @Override 
    438439                                                public void performAuto() { 
    439440                                                        getChanger().setRaw(FrameR4.KEY_BORDER__COLOR, input); 
     
    446447                                return false; 
    447448                        } 
    448449                } 
    449                  
    450450        } 
     451         
     452        /** 
     453         * Constant created for changing border opacity. 
     454         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     455         * Used for skinning. 
     456         */ 
     457        public static final String BORDER_OPACITY = "Change border opacity."; 
     458         
     459        /** 
     460         * Constant created for setting left border size. 
     461         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     462         * Used for skinning. 
     463         */ 
     464        public static final String LEFT_BORDER_SIZE = "Set left border size."; 
     465         
     466        /** 
     467         * Constant created for setting bottom border size. 
     468         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     469         * Used for skinning. 
     470         */ 
     471        public static final String BOTTOM_BORDER_SIZE = "Set bottom border size."; 
     472         
     473        /** 
     474         * Constant created for setting right border size. 
     475         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     476         * Used for skinning. 
     477         */ 
     478        public static final String RIGHT_BORDER_SIZE = "Set right border size."; 
     479         
     480        /** 
     481         * Constant created for setting top border size. 
     482         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     483         * Used for skinning. 
     484         */ 
     485        public static final String TOP_BORDER_SIZE = "Set top border size."; 
    451486} 
  • modules/org.sophie2.main.func.links/src/test/java/org/sophie2/main/func/links/LinksDemoTest.java

     
    1818import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1919import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2020import org.sophie2.base.skins.BaseSkinsModule; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.base.visual.BaseVisualModule; 
    2223import org.sophie2.core.modularity.SimpleSophieExtension; 
    2324import org.sophie2.core.modularity.SophieExtension; 
     
    5051public class LinksDemoTest extends AppTestBase { 
    5152 
    5253        /** 
     54         * Constant created for adding link rule. 
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. Used in the test. 
     57         */ 
     58        public static final String ADD_LINK_RULE = "Add link rule"; 
     59        /** 
    5360         * The number of times the demo action has been triggered. 
    5461         */ 
    5562        int actionTriggeredCount = -0; 
     
    208215                ImmList<LinkRule>rules =  page.getLink().getRules(); 
    209216                final Link link = new Link(rules.add(rule)); 
    210217                 
    211                 new AutoAction("Add link rule", true) { 
     218                new AutoAction(Message.create(ADD_LINK_RULE), true) { 
    212219                         
    213220                        @Override 
    214221                        public void performAuto() { 
  • modules/org.sophie2.extra.func.html/src/test/java/org/sophie2/extra/func/html/HtmlExportTest.java

     
    4747import org.sophie2.base.natlib.BaseNatlibModule; 
    4848import org.sophie2.base.persistence.BasePersistenceModule; 
    4949import org.sophie2.base.skins.BaseSkinsModule; 
     50import org.sophie2.base.skins.Message; 
    5051import org.sophie2.base.visual.BaseVisualModule; 
    5152import org.sophie2.core.logging.SophieLog; 
    5253import org.sophie2.core.modularity.CoreModularityModule; 
     
    7879 */ 
    7980public class HtmlExportTest extends AppTestBase { 
    8081 
     82        /** 
     83         * Constant created for inserting an image frame. 
     84         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     85         * Used for skinning. Used in the test. 
     86         */ 
     87        public static final String INSERT_IMAGE_FRAME = "Insert image frame"; 
     88 
     89        /** 
     90         * Constant created for setting up the second page's border. 
     91         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     92         * Used for skinning. Used in the test. 
     93         */ 
     94        public static final String SET_UP_SECOND_PAGE_BORDER = "Set up the second page's border."; 
     95 
     96        /** 
     97         * Constant created for adding a new page. 
     98         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     99         * Used for skinning. Used in the test. 
     100         */ 
     101        public static final String ADD_NEW_PAGE = "Add new page."; 
     102 
     103        /** 
     104         * Constant created for setting up the image frame. 
     105         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     106         * Used for skinning. Used in the test. 
     107         */ 
     108        public static final String SETTING_UP_IMAGE_FRAME = "Setting up the image frame"; 
     109 
    81110        private File file; 
    82111 
    83112        private static final String IMAGE_FILE_NAME = "funny-cat.jpg"; 
     
    161190                 * frame1 => bounds width:300.0px; height:240.0px; left:75.0px; 
    162191                 * top:75.0px; 
    163192                 */ 
    164                 new AutoAction("Setting up the image frame", true) { 
     193                new AutoAction(Message.create(SETTING_UP_IMAGE_FRAME), true) { 
    165194 
    166195                        @Override 
    167196                        public void performAuto() { 
     
    182211                final ResourceRefR4 page2Ref = ResourceRefR4.generateRandomSub("Page"); 
    183212                final ResourceRefList pages = book.get(BookR4.KEY_PAGES); 
    184213 
    185                 new AutoAction("Add new page.", true) { 
     214                new AutoAction(Message.create(ADD_NEW_PAGE), true) { 
    186215 
    187216                        @Override 
    188217                        public void performAuto() { 
     
    190219                        } 
    191220                }.register(book.getAccess()); 
    192221 
    193                 new AutoAction("Set up the second page's border.", true) { 
     222                new AutoAction(Message.create(SET_UP_SECOND_PAGE_BORDER), true) { 
    194223 
    195224                        @Override 
    196225                        public void performAuto() { 
     
    331360                        final ImmImage image = new ImmImage(imageFile, true); 
    332361                        final String name = imageFile.getName(); 
    333362                         
    334                         new AutoAction("Insert image frame", true) { 
     363                        new AutoAction(Message.create(INSERT_IMAGE_FRAME), true) { 
    335364 
    336365                                @Override 
    337366                                public void performAuto() { 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/access/OpenFunctionalityTest.java

     
    1818import org.sophie2.base.model.resources.r4.dummies.resources.DummyBook; 
    1919import org.sophie2.base.model.resources.r4.model.LocalResourceRevision; 
    2020import org.sophie2.base.persistence.BasePersistenceModule; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.core.modularity.FakeModuleRegistry; 
    2223import org.sophie2.core.testing.UnitTestBase; 
    2324 
     
    3031 */ 
    3132public class OpenFunctionalityTest extends UnitTestBase { 
    3233 
     34        /** 
     35         * Constant created for creating a page. 
     36         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     37         * Used for skinning. Used in the test. 
     38         */ 
     39        public static final String CREATE_PAGE = "Create a page"; 
    3340        private AppLocator locator; 
    3441         
    3542        @SuppressWarnings("unchecked") 
     
    118125                assertNotSame(access1, access2); 
    119126                final ResourceRefR4 pageRef = ResourceRefR4.makeChild("PageA"); 
    120127                final ResourceRefList pages = DummyBook.KEY_PAGES.get(access1); 
    121                 new AutoAction("Create an page", true) { 
     128                new AutoAction(Message.create(CREATE_PAGE), true) { 
    122129                        @Override 
    123130                        public void performAuto() { 
    124131                                DummyBookHelper.addNewPage(getChanger(), pageRef, pages); 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/changes/MetaChangeTest.java

     
    2626import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    2727import org.sophie2.base.model.resources.r4.model.RevisionId; 
    2828import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     29import org.sophie2.base.skins.Message; 
    2930import org.sophie2.core.modularity.FakeModuleRegistry; 
    3031import org.sophie2.core.testing.UnitTestBase; 
    3132 
     
    3637 */ 
    3738public class MetaChangeTest extends UnitTestBase { 
    3839 
     40        /** 
     41         * Constant created for skip. 
     42         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     43         * Used for skinning. Used in the test. 
     44         */ 
     45        public static final String SKIP = "skip"; 
     46         
     47        /** 
     48         * Constant created for setting the book title. 
     49         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     50         * Used for skinning. Used in the test. 
     51         */ 
     52        public static final String SET_THE_BOOK_TITLE = "Set the book title"; 
     53         
     54        /** 
     55         * Constant created for moving the frame down. 
     56         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     57         * Used for skinning. Used in the test. 
     58         */ 
     59        public static final String MOVE_THE_FRAME_DOWN = "Move the frame down."; 
     60         
     61        /** 
     62         * Constant created for making model change to skip.  
     63         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     64         * Used for skinning. Used in the test. 
     65         */ 
     66        public static final String MAKE_MODEL_CHANGE_TO_SKIP = "Make a model change to skip."; 
     67         
     68        /** 
     69         * Constant created for creating a page and frame in it. 
     70         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     71         * Used for skinning. Used in the test. 
     72         */ 
     73        public static final String CREATE_PAGE_AND_FRAME_IN_IT = "Create a page and frame in it."; 
     74         
     75        /** 
     76         * Constant created for changing page C. 
     77         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     78         * Used for skinning. Used in the test. 
     79         */ 
     80        public static final String CHANGES_PAGE_C = "Changes page C."; 
     81         
     82        /** 
     83         * Constant created for changing page B. 
     84         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     85         * Used for skinning. Used in the test. 
     86         */ 
     87        public static final String CHANGES_PAGE_B = "Changes page B."; 
     88         
     89        /** 
     90         * Constant created for creating frame 1 in page C. 
     91         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     92         * Used for skinning. Used in the test. 
     93         */ 
     94        public static final String CREATE_FRAME_1_IN_PAGE_C = "Create Frame 1 in page C."; 
     95         
     96        /** 
     97         * Constant created for setting up the page C background and border. 
     98         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     99         * Used for skinning. Used in the test. 
     100         */ 
     101        public static final String SETS_UP_THE_PAGE_C_BACKGROUND_AND_BORDER = "Sets up the page C background and border."; 
     102         
     103        /** 
     104         * Constant created for creating page C. 
     105         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     106         * Used for skinning. Used in the test. 
     107         */ 
     108        public static final String CREATE_PAGE_C = "Create page C."; 
     109         
     110        /** 
     111         * Constant created for creating page B. 
     112         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     113         * Used for skinning. Used in the test. 
     114         */ 
     115        public static final String CREATE_PAGE_B = "Create page B."; 
     116         
     117        /** 
     118         * Constant created for creating page A. 
     119         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     120         * Used for skinning. Used in the test. 
     121         */ 
     122        public static final String CREATE_PAGE_A = "Create page A."; 
    39123        private ResourceAccess access; 
    40124        private String bookTitle = "Book Title"; 
    41125         
     
    75159 
    76160                final ResourceRefR4 subRef = ResourceRefR4.makeChild("Page A"); 
    77161                 
    78                 new AutoAction("Create page A.", true) { 
     162                new AutoAction(Message.create(CREATE_PAGE_A), true) { 
    79163                        @Override 
    80164                        public void performAuto() { 
    81165                                getChanger().makeResource(subRef); 
     
    87171                }.register(this.access); 
    88172 
    89173                final ResourceRefR4 subRefB = ResourceRefR4.makeChild("Page B"); 
    90                 new AutoAction("Create page B.", true) { 
     174                new AutoAction(Message.create(CREATE_PAGE_B), true) { 
    91175                        @Override 
    92176                        public void performAuto() { 
    93177                                getChanger().makeResource(subRefB); 
     
    101185                RevisionId createPageBRevision = this.access.getHead().getId(); 
    102186 
    103187                final ResourceRefR4 subRefC = ResourceRefR4.makeChild("Page C"); 
    104                 new AutoAction("Create page C.", true) { 
     188                new AutoAction(Message.create(CREATE_PAGE_C), true) { 
    105189                        @Override 
    106190                        public void performAuto() { 
    107191                                getChanger().makeResource(subRefC); 
     
    114198                ResourceAccess pageAccessC = this.access.open(subRefC, null); 
    115199 
    116200                final ResourceRefR4 frameRef = ResourceRefR4.makeChild("FRAME_1");       
    117                 new AutoAction("Sets up the page C background and border.", true) { 
     201                new AutoAction(Message.create(SETS_UP_THE_PAGE_C_BACKGROUND_AND_BORDER), true) { 
    118202                        @Override 
    119203                        public void performAuto() { 
    120204                                getChanger().setRaw(StyledDummyResource.KEY_BACKGROUND__IMAGE, ResourceRefR4.NONE_REF); 
     
    126210                        } 
    127211                }.register(pageAccessC); 
    128212 
    129                 new AutoAction("Create Frame 1 in page C.", true) { 
     213                new AutoAction(Message.create(CREATE_FRAME_1_IN_PAGE_C), true) { 
    130214                        @Override 
    131215                        public void performAuto() { 
    132216                                getChanger().makeResource(frameRef); 
     
    134218                }.register(pageAccessC); 
    135219 
    136220                ResourceAccess pageAccessB = this.access.open(subRefB, null); 
    137                 new AutoAction("Changes page B.", true) { 
     221                new AutoAction(Message.create(CHANGES_PAGE_B), true) { 
    138222                        @Override 
    139223                        public void performAuto() { 
    140224                                getChanger().setRaw(StyledDummyResource.KEY_BACKGROUND__COLOR, ImmColor.GRAY); 
     
    144228                        } 
    145229                }.register(pageAccessB); 
    146230 
    147                 new AutoAction("Changes page C.", true) { 
     231                new AutoAction(Message.create(CHANGES_PAGE_C), true) { 
    148232                        @Override 
    149233                        public void performAuto() { 
    150234                                getChanger().setRaw(StyledDummyResource.KEY_BACKGROUND__COLOR, ImmColor.ORANGE); 
     
    195279        private void registerSkipChange(ImmList<RevisionId> revToSkip) { 
    196280                MetaChange change = new MetaChange(this.access.getAccessOptions().getUser(), 
    197281                                this.access.getAccessOptions().getViewId(), 
    198                                 "skip", MetaChangeType.SKIP, revToSkip); 
     282                                Message.create(SKIP), MetaChangeType.SKIP, revToSkip); 
    199283 
    200284                this.access.registerChange(change); 
    201285        } 
     
    245329                final ResourceRefR4 pageRef = ResourceRefR4.makeChild("PAGE_B"); 
    246330                final ResourceRefR4 frameRef = pageRef.sub(ResourceRefR4.makeChild("Frame")); 
    247331                final ImmPoint location = new ImmPoint(200.0f, 200.0f); 
    248                 new AutoAction("Create a page and frame in it.", true) { 
     332                new AutoAction(Message.create(CREATE_PAGE_AND_FRAME_IN_IT), true) { 
    249333                        @Override 
    250334                        public void performAuto() { 
    251335                                getChanger().makeResource(pageRef); 
     
    266350                } 
    267351                revToSkip.add(moveFrameDown(frameAccess, true)); 
    268352 
    269                 new AutoAction("Make an model change to skip.", true) { 
     353                new AutoAction(Message.create(MAKE_MODEL_CHANGE_TO_SKIP), true) { 
    270354                        @Override 
    271355                        public void performAuto() { 
    272356                                getChanger().setRaw(StyledDummyResource.KEY_BACKGROUND__COLOR, ImmColor.ORANGE); 
     
    280364 
    281365        private RevisionId moveFrameDown(ResourceAccess frameAccess, boolean isSignificant) { 
    282366 
    283                 new AutoAction("Move the frame down.", isSignificant) { 
     367                new AutoAction(Message.create(MOVE_THE_FRAME_DOWN), isSignificant) { 
    284368                        @Override 
    285369                        public void performAuto() { 
    286370                                final ImmPoint currentLocation = getChanger().getRaw( 
     
    313397        } 
    314398         
    315399        private RevisionId changeTitle(final String titleToSet) { 
    316                 new AutoAction("Set the book title", true) { 
     400                new AutoAction(Message.create(SET_THE_BOOK_TITLE), true) { 
    317401                        @Override 
    318402                        public void performAuto() { 
    319403                                getChanger().setRaw(ResourceR4.KEY_TITLE, titleToSet); 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/FrameHalosLogic.java

     
    1414import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1515import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
    1616import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     17import org.sophie2.base.skins.Message; 
    1718import org.sophie2.base.visual.VisualElement; 
    1819import org.sophie2.core.modularity.SortKey; 
    1920import org.sophie2.core.mvc.EventFilterBuilder; 
     
    5253                        ResourceAccess access = AppHaloUtil.getSingleFrameView(source).model().get().getAccess(); 
    5354                        Boolean state = ResourceFrame.KEY_MAIN_RESOURCE.getMode(access) == Mode.USE_TEMPLATE; 
    5455                        if (!state) { 
    55                                 new AutoAction("Set frame content templating.", true) { 
     56                                new AutoAction(Message.create(SET_FRAME_CONTENT_TEMPLATING), true) { 
    5657                                        @Override 
    5758                                        public void performAuto() {      
    5859                                                getChanger().setRaw(ResourceFrame.KEY_MAIN_RESOURCE, null); 
     
    171172                        ElementH parent = parentView.model().get(); 
    172173                        ResourceRefR4 frameRef = frame.getRef(); 
    173174                        ResourceRefR4 elementRef = frameRef.getThisChildRef(); 
    174                         parent.removeSubElement(elementRef, "Delete frame", true); 
     175                        parent.removeSubElement(elementRef, Message.create(DELETE_FRAME), true); 
    175176                        return true; 
    176177                } 
    177178 
    178179        }; 
    179180 
    180181        /** 
     182         * Constant created for deleting a frame. 
     183         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     184         * Used for skinning. 
     185         */ 
     186        public static final String DELETE_FRAME = "Delete frame"; 
     187         
     188        /** 
     189         * Constant created for changing frame z order. 
     190         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     191         * Used for skinning. 
     192         */ 
     193        public static final String CHANGE_FRAME_Z_ORDER = "Change frame zOrder"; 
     194         
     195        /** 
     196         * Constant created for setting frame content templating. 
     197         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     198         * Used for skinning. 
     199         */ 
     200        public static final String SET_FRAME_CONTENT_TEMPLATING = "Set frame content templating."; 
     201 
     202        /** 
    181203         * Changes the zOrder of the currently selected frame. 
    182204         *  
    183205         * Note that groups are treated as single elements, i.e. if you increase the 
     
    224246                final ImmList<ActivationChannel> newChannels =  
    225247                        channels.remove(index).add(newIndex, channel); 
    226248 
    227                 new AutoAction("Change frame zOrder", true) { 
     249                new AutoAction(Message.create(CHANGE_FRAME_Z_ORDER), true) { 
    228250 
    229251                        @Override 
    230252                        public void performAuto() { 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/HotTextLogic.java

     
    2727import org.sophie2.base.model.text.smart.highlight.HotHighlight; 
    2828import org.sophie2.base.model.text.smart.position.HotInterval; 
    2929import org.sophie2.base.model.text.smart.style.HotStyleDef; 
     30import org.sophie2.base.skins.Message; 
    3031import org.sophie2.base.visual.BaseVisualElement; 
    3132import org.sophie2.base.visual.VisualElement; 
    3233import org.sophie2.core.modularity.SortKey; 
     
    8687                                Change lastChange = model.getAccess().getHead().getLastChange(); 
    8788                                if ( lastChange != null && 
    8889                                                !lastChange.isSignificant() ) { 
    89                                         new AutoAction("Set text", true) { 
     90                                        new AutoAction(Message.create(SET_TEXT), true) { 
    9091         
    9192                                                @Override 
    9293                                                public void performAuto() { 
     
    9697                                } 
    9798                                significant = true; 
    9899                        } 
    99                         new AutoAction("Set text", significant) { 
     100                        new AutoAction(Message.create(SET_TEXT), significant) { 
    100101 
    101102                                @Override 
    102103                                public void performAuto() { 
     
    346347        }; 
    347348 
    348349        /** 
     350         * Constant created for setting text. 
     351         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     352         * Used for skinning. 
     353         */ 
     354        public static final String SET_TEXT = "Set text"; 
     355        /** 
    349356         * The color used to higlight search results. 
    350357         */ 
    351358        static final ImmColor SEARCH_HIGHLIGHT_COLOR = new ImmColor(1.0f, 1.0f, 0f, 0.2f); 
  • modules/org.sophie2.extra.func.browser/src/main/java/org/sophie2/extra/func/browser/flash/view/FlashLogic.java

     
    1818import org.sophie2.base.model.resources.r4.ResourceUtil; 
    1919import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2020import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.core.mvc.EventFilterBuilder; 
    2223import org.sophie2.core.mvc.OperationDef; 
    2324import org.sophie2.core.mvc.events.EventR3; 
     
    6667 
    6768                                final String frameTitle =  
    6869                                        ResourceUtil.getNextTitle(bv.getAccess().getRef(), FrameR4.DEFAULT_TITLE); 
    69                                 new AutoAction("Insert a flash frame.", true) { 
     70                                new AutoAction(Message.create(INSERT_A_FLASH_FRAME), true) { 
    7071 
    7172                                        @Override 
    7273                                        public void performAuto() { 
     
    105106                        FlashFrameView flashView = workArea.getSel().getSingleSelected( 
    106107                                        FlashFrameView.class); 
    107108 
    108                         new AutoAction("Change flash URL", true) { 
     109                        new AutoAction(Message.create(CHANGE_FLASH_URL), true) { 
    109110 
    110111                                @Override 
    111112                                public void performAuto() { 
     
    118119        }; 
    119120 
    120121        /** 
     122         * Constant created for changing the URL of a flash.  
     123         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     124         * Used for skinning. 
     125         */ 
     126        public static final String CHANGE_FLASH_URL = "Change flash URL"; 
     127         
     128        /** 
     129         * Constant created for inserting a flash frame.  
     130         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     131         * Used for skinning. 
     132         */ 
     133        public static final String INSERT_A_FLASH_FRAME = "Insert a flash frame."; 
     134 
     135        /** 
    121136         * Method that creates a file dialog to select a new url to flash file and 
    122137         * returns that url. 
    123138         *  
  • modules/org.sophie2.main.app.menus/src/test/java/org/sophie2/main/app/menus/WindowMenuTest.java

     
    1414import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    1515import org.sophie2.base.natlib.BaseNatlibModule; 
    1616import org.sophie2.base.skins.BaseSkinsModule; 
     17import org.sophie2.base.skins.Message; 
    1718import org.sophie2.base.visual.BaseVisualModule; 
    1819import org.sophie2.core.modularity.CoreModularityModule; 
    1920import org.sophie2.core.modularity.SophieModule; 
     
    3536 */ 
    3637public class WindowMenuTest extends AppTestBase { 
    3738         
     39        /** 
     40         * Constant created for setting book title. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. Used in the test. 
     43         */ 
     44        public static final String SET_BOOK_TITLE = "Set book title"; 
    3845        private BookH book; 
    3946         
    4047        @Override 
     
    8895        @Test 
    8996        public void testShortTitle() { 
    9097                final String title = TITLE_BASE; 
    91                 new AutoAction("Set book title", true) { 
     98                new AutoAction(Message.create(SET_BOOK_TITLE), true) { 
    9299                         
    93100                        @Override 
    94101                        public void performAuto() { 
     
    107114        @Test 
    108115        public void testLongTitle() { 
    109116                final String title = TITLE_BASE + TITLE_BASE + TITLE_BASE + TITLE_BASE; 
    110                 new AutoAction("Set book title", true) { 
     117                new AutoAction(Message.create(SET_BOOK_TITLE), true) { 
    111118                         
    112119                        @Override 
    113120                        public void performAuto() { 
  • modules/org.sophie2.extra.comment/src/main/java/org/sophie2/extra/comment/logic/CommentHudLogic.java

     
    44import org.sophie2.base.model.book.interfaces.ResourceFrame; 
    55import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    66import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     7import org.sophie2.base.skins.Message; 
    78import org.sophie2.core.logging.SophieLog; 
    89import org.sophie2.core.mvc.EventFilterBuilder; 
    910import org.sophie2.core.mvc.OperationDef; 
     
    5354                        if (streamRef != null) { 
    5455                                final ResourceRefR4 ref = streamRef; 
    5556                                 
    56                                 new AutoAction("Set comment stream ref", true) { 
     57                                new AutoAction(Message.create(SET_COMMENT_STREAM_REF), true) { 
    5758                                         
    5859                                        @Override 
    5960                                        public void performAuto() { 
     
    6566 
    6667                        return true; 
    6768                } 
    68         } 
     69        }; 
     70 
     71        /** 
     72         * Constant created for setting a comment stream reference. 
     73         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     74         * Used for skinning. 
     75         */ 
     76        public static final String SET_COMMENT_STREAM_REF = "Set comment stream ref"; 
    6977} 
  • modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/logic/ScriptingLogic.java

     
    1616import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1717import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1818import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.core.modularity.SortKey; 
    2021import org.sophie2.core.mvc.EventFilterBuilder; 
    2122import org.sophie2.core.mvc.OperationDef; 
     
    6364                        final ResourceRefR4 scriptRef =  
    6465                                ResourceRefR4.generateRandomSub(ScriptResourceH.NAME_PREFIX);  
    6566 
    66                         new AutoAction("Insert script", true) { 
     67                        new AutoAction(Message.create(INSERT_SCRIPT), true) { 
    6768                                 
    6869                                @Override 
    6970                                public void performAuto() { 
     
    161162                                return false; 
    162163                        } 
    163164 
    164                         new AutoAction("Insert script from a file", true) { 
     165                        new AutoAction(Message.create(INSERT_SCRIPT_FROM_A_FILE), true) { 
    165166 
    166167                                @Override 
    167168                                public void performAuto() { 
     
    192193 
    193194                        final String newText = window.textArea().get().getText(); 
    194195                        if (!resource.getScriptText().equals(newText)) { 
    195                                 new AutoAction("Edit Script", true) { 
     196                                new AutoAction(Message.create(EDIT_SCRIPT), true) { 
    196197                                         
    197198                                        @Override 
    198199                                        public void performAuto() { 
     
    276277                        return true; 
    277278                } 
    278279        }; 
     280 
     281        /** 
     282         * Constant created for editting a script. 
     283         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     284         * Used for skinning. 
     285         */ 
     286        public static final String EDIT_SCRIPT = "Edit Script"; 
     287         
     288        /** 
     289         * Constant created for inserting a script. 
     290         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     291         * Used for skinning. 
     292         */ 
     293        public static final String INSERT_SCRIPT = "Insert script"; 
     294         
     295        /** 
     296         * Constant created for inserting a script from a file. 
     297         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     298         * Used for skinning. 
     299         */ 
     300        public static final String INSERT_SCRIPT_FROM_A_FILE = "Insert script from a file"; 
    279301} 
  • modules/org.sophie2.server.webui/src/main/java/org/sophie2/server/webui/handlers/EditProfileHandler.java

     
    1818import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    1919import org.sophie2.base.model.security.UserH; 
    2020import org.sophie2.base.model.security.UserR4; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.server.core.ServerResourceHelper; 
    2223import org.sophie2.server.webapp.RequestUtils; 
    2324import org.sophie2.server.webui.BaseHandlerSupport; 
     
    3637public class EditProfileHandler extends BaseHandlerSupport { 
    3738 
    3839        /** 
     40         * Constant created for editing user info.  
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. 
     43         */ 
     44        public static final String EDIT_USER_INFO = "Edit user info"; 
     45        /** 
    3946         * Default serial version ID. 
    4047         */ 
    4148        private static final long serialVersionUID = 1L; 
     
    98105 
    99106                                final String screenName = context.getRequestParameter("screenName"); 
    100107                                final boolean changedName = !userH.getTitle().equals(screenName); 
    101                                 new AutoAction("Edit user info", true) { 
     108                                new AutoAction(Message.create(EDIT_USER_INFO), true) { 
    102109                                        @Override 
    103110                                        public void performAuto() { 
    104111                                                ResourceChanger changer = getChanger(); 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/chaining/TextChainingLogic.java

     
    2222import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2323import org.sophie2.base.model.text.smart.ImmHotText; 
    2424import org.sophie2.base.model.text.smart.position.HotInterval; 
     25import org.sophie2.base.skins.Message; 
    2526import org.sophie2.core.modularity.SortKey; 
    2627import org.sophie2.core.mvc.EventFilterBuilder; 
    2728import org.sophie2.core.mvc.OperationDef; 
     
    7879                        ChainHudElement element = input.getSelectedItem(); 
    7980                        if (ChainHudElement.NO_CHAINING_ELEM.equals(element)) { 
    8081                                if (!ChainingMode.NO_CHAINING.equals(headH.getChainMode())) { 
    81                                         new AutoAction("Turn-off chaining", true) { 
     82                                        new AutoAction(Message.create(TURN_OFF_CHAINING), true) { 
    8283                                                @Override 
    8384                                                public void performAuto() { 
    8485                                                        getChanger().setRaw(TextTemplateR4.KEY_CHAIN_MODE, ChainingMode.NO_CHAINING); 
     
    8889                                res = true; 
    8990                        } else if (ChainHudElement.AUTO_CHAIN_ELEM.equals(element)) { 
    9091                                if (!ChainingMode.AUTO_CHAINING.equals(headH.getChainMode())) { 
    91                                         new AutoAction("Start auto-chaining", true) { 
     92                                        new AutoAction(Message.create(START_AUTO_CHAINING), true) { 
    9293                                                @Override 
    9394                                                public void performAuto() { 
    9495                                                        getChanger().setRaw(TextTemplateR4.KEY_CHAIN_MODE, ChainingMode.AUTO_CHAINING); 
     
    234235        }; 
    235236 
    236237        /** 
     238         * Constant created for starting auto chaining. 
     239         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     240         * Used for skinning. 
     241         */ 
     242        public static final String START_AUTO_CHAINING = "Start auto-chaining"; 
     243         
     244        /** 
     245         * Constant created for turning off chaining. 
     246         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     247         * Used for skinning. 
     248         */ 
     249        public static final String TURN_OFF_CHAINING = "Turn-off chaining"; 
     250         
     251        /** 
     252         * Constant created for chaining text frame. 
     253         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     254         * Used for skinning. 
     255         */ 
     256        public static final String CHAIN_TEXT_FRAME = "Chain text frame"; 
     257         
     258        /** 
     259         * Constant created for combining text of chained frames. 
     260         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     261         * Used for skinning. 
     262         */ 
     263        public static final String COMBINE_TEXT_OF_CHAINED_FRAMES = "Combine text of chained frames"; 
     264         
     265        /** 
     266         * Constant created for updating head references. 
     267         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     268         * Used for skinning. 
     269         */ 
     270        public static final String UPDATE_HEAD_REFERENCES = "Update head references"; 
     271         
     272        /** 
     273         * Constant created for splitting text chain. 
     274         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     275         * Used for skinning. 
     276         */ 
     277        public static final String SPLIT_TEXT_CHAIN = "Split text chain"; 
     278 
     279        /** 
    237280         * Chains a text frame at the specified offset after the given view. 
    238281         *  
    239282         * @param prevView 
     
    291334                        mergeChains(chainedFramesMap, bookRef, headFrameRef, chainOrder, bookAccess); 
    292335                } 
    293336 
    294                 new AutoAction("Chain text frame", significant) { 
     337                new AutoAction(Message.create(CHAIN_TEXT_FRAME), significant) { 
    295338 
    296339                        @Override 
    297340                        public void performAuto() { 
     
    329372                        final ResourceRefR4 newTextRef = ResourceRefR4.generateRandomSub(HotTextResourceR4.KIND); 
    330373                        final String newTextTitle = ResourceUtil.getNextTitle(bookRef, HotTextResourceR4.DEFAULT_TITLE); 
    331374                        final ImmHotText textToSet = firstFrameText.replace(interval, secondFrameText); 
    332                         new AutoAction("Combine text of chained frames", false) { 
     375                        new AutoAction(Message.create(COMBINE_TEXT_OF_CHAINED_FRAMES), false) { 
    333376 
    334377                                @Override 
    335378                                public void performAuto() { 
     
    349392                        final ResourceRefR4 bookRef, final ResourceRefR4 headFrameRef,  
    350393                        final String chainOrder, ResourceAccess bookAccess) { 
    351394 
    352                 new AutoAction("Update head references", false) { 
     395                new AutoAction(Message.create(UPDATE_HEAD_REFERENCES), false) { 
    353396                        @Override 
    354397                        public void performAuto() { 
    355398                                for (ImmEntry<ResourceRefR4, String> entry : chainedFrames.asList()) { 
     
    454497                        newTitle = ""; //This is not needed but the compiler doesn't understand it 
    455498                        newTextRef = headHelper.getMainResource().getThisChildRef(); 
    456499                } 
    457                 new AutoAction("Split text chain", isSign) { 
     500                new AutoAction(Message.create(SPLIT_TEXT_CHAIN), isSign) { 
    458501 
    459502                        @Override 
    460503                        public void performAuto() { 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/book/panels/BookPanelLogic.java

     
    77import org.sophie2.base.model.book.BookH; 
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    99import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     10import org.sophie2.base.skins.Message; 
    1011import org.sophie2.core.logging.SophieLog; 
    1112import org.sophie2.core.modularity.SortKey; 
    1213import org.sophie2.core.mvc.EventFilterBuilder; 
     
    256257                        BookH clone = docView.model().get().clone(mainWindow.locator().get()); 
    257258                        final String newTitle = BookH.PREVIEW_TITLE_PREFIX + clone.getTitle();  
    258259 
    259                         new AutoAction("Update preview", false) {  
     260                        new AutoAction(Message.create(UPDATE_PREVIEW), false) {  
    260261 
    261262                                @Override  
    262263                                public void performAuto() {  
     
    317318        }; 
    318319         
    319320        /** 
     321         * Constant created for updating a preview. 
     322         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     323         * Used for skinning. 
     324         */ 
     325        public static final String UPDATE_PREVIEW = "Update preview"; 
     326 
     327        /** 
    320328         * Goes to a page with a given index if possible. 
    321329         *  
    322330         * @param bookView 
  • modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/facade/JSPage.java

     
    99import org.sophie2.base.model.book.PageH; 
    1010import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1111import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
     12import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1213import org.sophie2.base.model.text.smart.ImmHotText; 
     14import org.sophie2.base.skins.Message; 
    1315import org.sophie2.main.app.commons.book.BookDocView; 
    1416import org.sophie2.main.app.commons.frame.FrameView; 
    1517import org.sophie2.main.app.commons.page.RootPageView; 
     
    2325 */ 
    2426public class JSPage extends BaseJSAdapter<RootPageView> { 
    2527 
     28        /** 
     29         * Constant created for expressing that frame is created using scripting. 
     30         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     31         * Used for skinning. 
     32         */ 
     33        public static final String SCRIPTING_CREATE_FRAME = "Scripting: Create frame"; 
     34 
     35        /** 
     36         * Constant created for expressing that frame is deleted using scripting. 
     37         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     38         * Used for skinning. 
     39         */ 
     40        public static final String SCRIPTING_DELETE_FRAME = "Scripting: Delete frame"; 
     41 
    2642        private static final long serialVersionUID = 8411359364027540572L; 
    2743 
    2844        /** 
     
    114130                ImmHotText hotText = ImmHotText.createPlain(frameText); 
    115131 
    116132                HeadTextFrameH.createTextFrameAction(book, page, hotText, ResourceRefR4.NONE_REF.toUri(), 
    117                                 null, "Scripting: Create frame", false); 
     133                                null, Message.create(SCRIPTING_CREATE_FRAME), false); 
    118134                 
    119135                JSFrame result = (JSFrame) Context.getCurrentContext().newObject( 
    120136                                getParentScope(), JSFrame.CLASS_NAME); 
     
    135151        public void jsFunction_removeFrame(JSFrame jsFrame) { 
    136152                FrameView frameView = jsFrame.getAdaptedObject(); 
    137153                ResourceRefR4 ref = frameView.model().get().getRef(); 
    138                 getAdaptedObject().model().get().removeSubElement(ref, "Scripting: Delete frame", false); 
     154                getAdaptedObject().model().get().removeSubElement(ref, Message.create(SCRIPTING_DELETE_FRAME), false); 
    139155        } 
    140156 
    141157} 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/BackgroundColorField.java

     
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    99import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    1010import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     11import org.sophie2.base.skins.Message; 
    1112import org.sophie2.base.visual.BaseVisualElement; 
    1213import org.sophie2.base.visual.VisualElement; 
    1314import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    9596                                 
    9697                                assert input != null; 
    9798                                 
    98                                 new AutoAction("Change background color", true) { 
     99                                new AutoAction(Message.create(BG_COLOR), true) { 
    99100                                        @Override 
    100101                                        public void performAuto() { 
    101102                                                ResourceChanger changer = getChanger(); 
     
    110111                         
    111112                } 
    112113        } 
     114         
     115        /** 
     116         * Constant created for changing background color. 
     117         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     118         * Used for skinning. 
     119         */ 
     120        public static final String BG_COLOR = "Change background color"; 
    113121} 
  • modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/frame/FrameTemplateLogic.java

     
    1616import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1717import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1818import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.core.logging.SophieLog; 
    2021import org.sophie2.core.modularity.SortKey; 
    2122import org.sophie2.core.mvc.EventFilterBuilder; 
     
    185186 
    186187                        String frameTitle = ResourceR4.KEY_TITLE.get(bookDocView.getAccess().open(template, null)); 
    187188                        if (TemplatePaletteUtil.confirmDeletion(frameTitle, bookDocView.swingComponent().get())) { 
    188                                 new AutoAction("Delete frame template.", true) { 
     189                                new AutoAction(Message.create(DELETE_FRAME_TEMPLATE), true) { 
    189190 
    190191                                        @Override 
    191192                                        public void performAuto() { 
     
    201202                } 
    202203 
    203204        }; 
    204  
     205         
     206        /** 
     207         * Constant created for deleting frame template. 
     208         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     209         * Used for skinning. 
     210         */ 
     211        public static final String DELETE_FRAME_TEMPLATE = "Delete frame template."; 
    205212} 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/view/TextLinksHud.java

     
    1212import org.sophie2.base.model.text.mvc.TextViewFlow; 
    1313import org.sophie2.base.model.text.smart.ImmHotText; 
    1414import org.sophie2.base.model.text.smart.position.HotInterval; 
     15import org.sophie2.base.skins.Message; 
    1516import org.sophie2.base.skins.SkinElementId; 
    1617import org.sophie2.base.visual.BaseSwingVisualElement; 
    1718import org.sophie2.base.visual.BaseVisualElement; 
     
    224225                                TextLinksHud hud = event.getSource(TextLinksHud.class); 
    225226                                Link newLink = event.getEventParam(LinksHudLogic.EventIds.LINK_PARAM_INDEX, Link.class); 
    226227                                LinkAttachment textLink = LinkAttachment.DEFAULT_LINK_ATTACHMENT.setLink(newLink); 
    227                                 String description = event.getEventParam(LinksHudLogic.EventIds.DESCRIPTION_PARAM_INDEX, String.class); 
     228                                Message description = event.getEventParam(LinksHudLogic.EventIds.DESCRIPTION_PARAM_INDEX, Message.class); 
    228229                                 
    229230                                TextFrameView frameView = AppHaloUtil.getSingleSelected(hud, TextFrameView.class); 
    230231                                TextViewFlow flow = frameView.textFlow().get(); 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/keys/TemplatedResourceRefKeyTest.java

     
    1515import org.sophie2.base.model.resources.r4.dummies.helpers.DummyBookHelper; 
    1616import org.sophie2.base.model.resources.r4.dummies.resources.DummyFrame; 
    1717import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.core.logging.LogLevel; 
    1920import org.sophie2.core.logging.SophieLog; 
    2021import org.sophie2.core.modularity.FakeModuleRegistry; 
     
    2728 */ 
    2829public class TemplatedResourceRefKeyTest extends UnitTestBase { 
    2930 
     31        /** 
     32         * Constant created for applying template. 
     33         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     34         * Used for skinning. Used in the test. 
     35         */ 
     36        public static final String APPLYING_TEMPLATE = "applying template"; 
     37         
     38        /** 
     39         * Constant created for creating resources. 
     40         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     41         * Used for skinning. Used in the test. 
     42         */ 
     43        public static final String RESOURCES_CREATED = "resources created"; 
    3044        private ResourceAccess access; 
    3145 
    3246        @SuppressWarnings("unchecked") 
     
    7488                final ResourceRefR4 frameToTemplate = ResourceRefR4.getRelativeRef(page.sub(frame), template); 
    7589                final ResourceRefR4 templateToImage = ResourceRefR4.getRelativeRef(template, image); 
    7690 
    77                 new AutoAction("resources created", true) { 
     91                new AutoAction(Message.create(RESOURCES_CREATED), true) { 
    7892                        @Override 
    7993                        public void performAuto() { 
    8094                                getChanger().makeResource(page); 
     
    92106 
    93107                assertEquals(ResourceRefR4.NONE_REF, mainResource1); 
    94108 
    95                 new AutoAction("applying template", true) { 
     109                new AutoAction(Message.create(APPLYING_TEMPLATE), true) { 
    96110                        @Override 
    97111                        public void performAuto() { 
    98112                                getChanger().setRaw(ResourceR4.KEY_TEMPLATE, frameToTemplate); 
  • modules/org.sophie2.base.connectivity/src/main/java/org/sophie2/base/connectivity/resources/binary/ServerBinaryModifier.java

     
    2121import org.sophie2.base.model.resources.r4.keys.Key; 
    2222import org.sophie2.base.model.resources.r4.keys.RootKey; 
    2323import org.sophie2.base.model.resources.r4.model.ResourceModel; 
     24import org.sophie2.base.skins.Message; 
    2425 
    2526/** 
    2627 * Modifies writes containing {@link BinData} from the server, 
     
    177178 
    178179                        return new ModelChange(old.getChangeScope(), 
    179180                                        old.getUser(), old.getViewId(), 
    180                                         old.getDescription(), old.isSignificant(), 
     181                                        Message.create(old.getDescription()), old.isSignificant(), 
    181182                                        old.getActionClass(), newFields); 
    182183                } 
    183184 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/model/HeadTextFrameH.java

     
    2222import org.sophie2.base.model.resources.r4.changes.SubResourceChanger; 
    2323import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    2424import org.sophie2.base.model.text.smart.ImmHotText; 
     25import org.sophie2.base.skins.Message; 
    2526import org.sophie2.main.func.text.chaining.ChainingMode; 
    2627import org.sophie2.main.func.text.view.ChainManager; 
    2728 
     
    3334public class HeadTextFrameH extends TextFrameH { 
    3435 
    3536        /** 
     37         * Constant created for inserting text frame. 
     38         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     39         * Used for skinning. 
     40         */ 
     41        public static final String INSERT_TEXT_FRAME = "Insert text frame"; 
     42 
     43        /** 
    3644         * A constructor with {@link ResourceAccess}. 
    3745         *  
    3846         * @param access 
     
    132140         */ 
    133141        public static ResourceRefR4 createTextFrameAction(BookH book, ElementH parent, 
    134142                        final ImmHotText text, final URI importOrigin, ImmPoint importPosition, 
    135                         String actionDescription, boolean significant) { 
     143                        Message actionDescription, boolean significant) { 
    136144 
    137145                ResourceRefR4 bookRef = book.getRef();           
    138146                final ResourceRefR4 parentRef = ResourceRefR4.getRelativeRef(bookRef, parent.getRef()); 
     
    198206                                book.getAccess().getRef(), HotTextResourceR4.DEFAULT_TITLE); 
    199207 
    200208                final ImmHotText hotText = ImmHotText.createPlain(text); 
    201                         new AutoAction("Insert text frame", true) { 
     209                        new AutoAction(Message.create(INSERT_TEXT_FRAME), true) { 
    202210                                 
    203211                                @Override 
    204212                                public void performAuto() { 
  • modules/org.sophie2.base.connectivity/src/main/java/org/sophie2/base/connectivity/resources/ResourceDirectoryH.java

     
    2222import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    2323import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    2424import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     25import org.sophie2.base.skins.Message; 
    2526 
    2627/** 
    2728 * Helper class for {@link ResourceDirectoryR4} resources. 
     
    197198                final ResourceRefR4 childRef = ResourceRefR4.makeChild(name); 
    198199                final ResourceRefList subDirectories = parent.getResources(); 
    199200                ResourceAccess parentAccess = parent.getAccess(); 
    200                 new AutoAction("Create " + name + " directory.", true) { 
     201                new AutoAction(Message.create(CREATE_DIR, name), true) { 
    201202                        @Override 
    202203                        public void performAuto() { 
    203204                                ResourceDirectoryH.addSubDirectory(getChanger(), childRef, 
     
    208209                return ResourceH.getHelper(parentAccess.open(childRef, null), 
    209210                                ResourceDirectoryH.class); 
    210211        } 
     212         
     213        /** 
     214         * Constant created for creating a directory by name. 
     215         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     216         * Used for skinning. 
     217         */ 
     218        public static final String CREATE_DIR = "Create %1$s directory."; 
    211219 
    212220        private static final <T extends ResourceH> T createResource( 
    213221                        ResourceDirectoryH directory, String name, String kind, 
     
    220228                final ResourceRefR4 childRef = ResourceRefR4.makeChild(name); 
    221229                final ResourceRefList resources = directory.getResources(); 
    222230                ResourceAccess directoryAccess = directory.getAccess(); 
    223                 new AutoAction("Create " + name + " as " + kind + " resource in " 
    224                                 + directory.getName() + ".", true) { 
     231                new AutoAction(Message.create(CREATE_RES, name, kind, directory.getName()), true) { 
    225232                        @Override 
    226233                        public void performAuto() { 
    227234                                ResourceDirectoryH.addResource(getChanger(), childRef, 
     
    233240                                helperClass); 
    234241                return helper; 
    235242        } 
     243         
     244        /** 
     245         * Constant created for creating a resource. 
     246         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     247         * Used for skinning. Used in the test. 
     248         */ 
     249        public static final String CREATE_RES = "Create %1$s as %2$s resource in %3$s."; 
    236250 
    237251        /** 
    238252         * Helper method which will be removed. Creates a resource in a server 
     
    279293                final ResourceRefR4 childRef = ResourceRefR4.makeChild(name); 
    280294                final ResourceRefList resources = directory.getResources(); 
    281295                ResourceAccess directoryAccess = directory.getAccess(); 
    282                 new AutoAction("Create " + name + " resource in " 
    283                                 + directory.getName() + ".", true) { 
     296                new AutoAction(Message.create(CREATE_RES_IN_DIR, name, directory.getName()), true) { 
    284297                        @Override 
    285298                        public void performAuto() { 
    286299                                ResourceDirectoryH.addResource(getChanger(), childRef, 
     
    291304        } 
    292305 
    293306        /** 
     307         * Constant created for creating a resource in a directory. 
     308         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     309         * Used for skinning. Used in the test. 
     310         */ 
     311        public static final String CREATE_RES_IN_DIR = "Create %1$s resource in %2$s."; 
     312         
     313        /** 
    294314         * Registers action on a directory access which deletes a resource from that 
    295315         * directory.  
    296316         * @param directoryAccess 
     
    306326                } 
    307327                final ResourceRefList curResources =  
    308328                        ResourceDirectoryR4.KEY_RESOURCES.get(directoryAccess); 
    309                 new AutoAction("Delete " + resourceRef.getName(), true) { 
     329                new AutoAction(Message.create(DELETE_RES, resourceRef.getName()), true) { 
    310330                        @Override 
    311331                        public void performAuto() { 
    312332                                ResourceDirectoryH.removeResource( 
     
    315335                }.register(directoryAccess); 
    316336        } 
    317337 
     338        /** 
     339         * Constant created for deleting a resource. 
     340         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     341         * Used for skinning. 
     342         */ 
     343        public static final String DELETE_RES = "Delete %1$s"; 
    318344} 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/BackgroundGradientField.java

     
    1111import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1212import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    1313import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     14import org.sophie2.base.skins.Message; 
    1415import org.sophie2.base.visual.BaseVisualElement; 
    1516import org.sophie2.base.visual.VisualElement; 
    1617import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    8081                                                source, AppearanceHud.class); 
    8182                                final ResourceAccess access = hud.access().get(); 
    8283                                final ImmGradient input = event.getEventParam(EventIds.GRADIENT_PARAM_INDEX, ImmGradient.class); 
    83                                 new AutoAction("Change background gradient", true) { 
     84                                new AutoAction(Message.create(BG_GRADIENT), true) { 
    8485                                        @Override 
    8586                                        public void performAuto() { 
    8687                                                ResourceChanger changer = getChanger(); 
     
    9596                         
    9697                } 
    9798        } 
     99         
     100        /** 
     101         * Constant created for changing background gradient. 
     102         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     103         * Used for skinning. 
     104         */ 
     105        public final static String BG_GRADIENT = "Change background gradient"; 
    98106} 
  • modules/org.sophie2.main.app.commons/src/test/java/org/sophie2/main/app/commons/logic/BookWindowOperationTest.java

     
    1717import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    1818import org.sophie2.base.natlib.BaseNatlibModule; 
    1919import org.sophie2.base.skins.BaseSkinsModule; 
     20import org.sophie2.base.skins.Message; 
    2021import org.sophie2.base.visual.BaseVisualModule; 
    2122import org.sophie2.core.modularity.SophieModule; 
    2223import org.sophie2.core.mvc.CoreMvcModule; 
     
    3839 */ 
    3940public class BookWindowOperationTest extends AppTestBase { 
    4041 
     42        /** 
     43         * Constant created for setting book title using scripting. 
     44         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     45         * Used for skinning. 
     46         */ 
     47        public static final String SCRIPTING_SET_BOOK_TITLE = "Scripting: Set book title"; 
    4148        private BookDocView bdw; 
    4249         
    4350        @Override 
     
    103110         */ 
    104111        @Test 
    105112        public void testModifiedBookClosed() { 
    106                 new AutoAction("Scripting: Set book title", false) { 
     113                new AutoAction(Message.create(SCRIPTING_SET_BOOK_TITLE), false) { 
    107114                         
    108115                        @Override 
    109116                        public void performAuto() { 
  • modules/org.sophie2.server.webui/src/main/java/org/sophie2/server/webui/handlers/RegisterHandler.java

     
    1515import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    1616import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    1717import org.sophie2.base.model.security.UserR4; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.server.core.ServerResourceHelper; 
    1920import org.sophie2.server.webapp.RequestUtils; 
    2021import org.sophie2.server.webui.BaseHandlerSupport; 
     
    3233public class RegisterHandler extends BaseHandlerSupport { 
    3334 
    3435        /** 
     36         * Constant created for making a new user. 
     37         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     38         * Used for skinning. 
     39         */ 
     40        public static final String MAKE_NEW_USER = "Make a new user"; 
     41        /** 
    3542         * The serial version UID of this class. 
    3643         */ 
    3744        private static final long serialVersionUID = 1L; 
     
    107114                } 
    108115 
    109116                final ResourceRefR4 userRef = ResourceRefR4.makeChild(userName); 
    110                 new AutoAction("Make a new user", true) { 
     117                new AutoAction(Message.create(MAKE_NEW_USER), true) { 
    111118 
    112119                        @Override 
    113120                        public void performAuto() { 
  • modules/org.sophie2.main.func.text/src/main/java/org/sophie2/main/func/text/utils/TextChainUtils.java

     
    3030import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    3131import org.sophie2.base.model.text.mvc.TextViewFlow; 
    3232import org.sophie2.base.model.text.smart.ImmHotText; 
     33import org.sophie2.base.skins.Message; 
    3334import org.sophie2.main.app.commons.book.BookView; 
    3435import org.sophie2.main.app.commons.element.ElementView; 
    3536import org.sophie2.main.app.commons.frame.FrameView; 
     
    5960public class TextChainUtils { 
    6061 
    6162        /** 
     63         * Constant created for changing the head frame's template head reference. 
     64         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     65         * Used for skinning. 
     66         */ 
     67        public static final String CHANGE_THE_HEAD_FRAME_S_TEMPLATE_HEAD_REF = "Change the head frame's template head ref"; 
     68         
     69        /** 
     70         * Constant created for expanding auto chaining. 
     71         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     72         * Used for skinning. 
     73         */ 
     74        public static final String EXPAND_AUTO_CHAIN = "Expand auto-chain"; 
     75         
     76        /** 
     77         * Constant created for auto-fitting text flow. 
     78         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     79         * Used for skinning. 
     80         */ 
     81        public static final String AUTO_FIT_TEXT_FLOW = "Auto-fit text flow."; 
     82         
     83        /** 
    6284         * Comparator used to order text views of the same chains by their chain order. 
    6385         */ 
    6486        public static Comparator<TextFrameView> TEXT_VIEW_COMP = new Comparator<TextFrameView>() { 
     
    157179                chainMaster.massCnanging().set(false); 
    158180 
    159181                if (changesMade) { 
    160                         AutoAction.registerEndChange(bookH.getAccess(), "Auto-fit text flow."); 
     182                        AutoAction.registerEndChange(bookH.getAccess(), Message.create(AUTO_FIT_TEXT_FLOW)); 
    161183                } 
    162184        } 
    163185 
     
    317339                final ResourceRefList pages = book.getPages(); 
    318340                final int lastPageIndex = book.getIndexOf(page.getAccess().getRef());  
    319341                //TODO There is too much similar logic - extract common logic in methods :} 
    320                 new AutoAction("Expand auto-chain", false) { 
     342                new AutoAction(Message.create(EXPAND_AUTO_CHAIN), false) { 
    321343                        @Override 
    322344                        public void performAuto() { 
    323345 
     
    533555                                                ResourceRefR4.getRelativeRef(bookH.getRef(), thisHeadH.getRef()); 
    534556                                        if (ChainingMode.AUTO_CHAINING.equals(thisHeadH.getChainMode())) { 
    535557                                                ResourceAccess frameTemplateAccess = bookH.getAccess().open(frameTemplRef, null); 
    536                                                 new AutoAction("Change the head frame's template head ref", false) { 
     558                                                new AutoAction(Message.create(CHANGE_THE_HEAD_FRAME_S_TEMPLATE_HEAD_REF), false) { 
    537559                                                        @Override 
    538560                                                        public void performAuto() { 
    539561                                                                getChanger().setRaw(ResourceR4.KEY_KIND, TailTextFrameR4.KIND); 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/resource/r4/InnerAccessTest.java

     
    1414import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1515import org.sophie2.base.model.resources.r4.changes.SubResourceChanger; 
    1616import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     17import org.sophie2.base.skins.Message; 
    1718import org.sophie2.core.testing.UnitTestBase; 
    1819 
    1920/** 
     
    2425public class InnerAccessTest extends UnitTestBase{ 
    2526         
    2627        /** 
     28         * Constant created for changing frame's background color to pink. 
     29         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     30         * Used for skinning. Used in the test. 
     31         */ 
     32        public static final String CHANGE_FRAME_S_BACKGROUND_COLOR_TO_PINK = "Change frame's background color to pink"; 
     33         
     34        /** 
     35         * Constant created for changing frame`s background color to green. 
     36         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     37         * Used for skinning. Used in the test. 
     38         */ 
     39        public static final String CHANGE_FRAME_S_BACKGROUND_COLOR_TO_GREEN = "Change frame`s background color to green"; 
     40         
     41        /** 
     42         * Constant created for creating frame through the page access. 
     43         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     44         * Used for skinning. Used in the test. 
     45         */ 
     46        public static final String CREATE_FRAME_THROUGH_THE_PAGE_ACCESS = "Create Frame through the page access"; 
     47         
     48        /** 
     49         * Constant created for changing the background color to green. 
     50         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     51         * Used for skinning. Used in the test. 
     52         */ 
     53        public static final String CHANGE_THE_BACKGROUND_COLOR_TO_GREEN = "Change the background color to Green"; 
     54 
     55        /** 
    2756         * Tests registering changes through inner accesses. 
    2857         */ 
    2958        @Test 
     
    3766                DelegatingMemAccess pageAccess = (DelegatingMemAccess) access.open(pageA_Ref, null);  
    3867                assertEquals(ImmColor.GRAY, pageAccess.getRaw(StyledElement.KEY_BACKGROUND__COLOR)); 
    3968         
    40                 new AutoAction("Change the background color to Green", true) { 
     69                new AutoAction(Message.create(CHANGE_THE_BACKGROUND_COLOR_TO_GREEN), true) { 
    4170                        @Override 
    4271                        public void performAuto() { 
    4372                                getChanger().setRaw(StyledElement.KEY_BACKGROUND__COLOR, ImmColor.GREEN); 
     
    4776                assertEquals(ImmColor.GREEN, pageAccess.getRaw(StyledElement.KEY_BACKGROUND__COLOR)); 
    4877 
    4978                final ResourceRefR4 frame_Ref = ResourceRefR4.make("./NEW_FRAME"); 
    50                 new AutoAction("Create Frame through the page access", true) { 
     79                new AutoAction(Message.create(CREATE_FRAME_THROUGH_THE_PAGE_ACCESS), true) { 
    5180                        @Override 
    5281                        public void performAuto() { 
    5382                                getChanger().makeResource(frame_Ref); 
     
    6594                DelegatingMemAccess frameAccess = (DelegatingMemAccess) access.open(pageA_Ref.append(frame_Ref), null);  
    6695                assertEquals(ImmColor.ORANGE, frameAccess.getRaw(StyledElement.KEY_BACKGROUND__COLOR)); 
    6796                 
    68                 new AutoAction("Change frame`s background color to green", true) { 
     97                new AutoAction(Message.create(CHANGE_FRAME_S_BACKGROUND_COLOR_TO_GREEN), true) { 
    6998                        @Override 
    7099                        public void performAuto() { 
    71100                                getChanger().setRaw(StyledElement.KEY_BACKGROUND__COLOR, ImmColor.GREEN); 
     
    75104                 
    76105                // Inner access with parent - inner access 
    77106                DelegatingMemAccess frameAccess2 = (DelegatingMemAccess) pageAccess.open(frame_Ref, null); 
    78                 new AutoAction("Change frame's background color to pink", true) { 
     107                new AutoAction(Message.create(CHANGE_FRAME_S_BACKGROUND_COLOR_TO_PINK), true) { 
    79108                        @Override 
    80109                        public void performAuto() { 
    81110                                getChanger().setRaw(StyledElement.KEY_BACKGROUND__COLOR, ImmColor.PINK); 
  • modules/org.sophie2.main.app.layout/src/main/java/org/sophie2/main/app/layout/left/pages/PageReorderHandler.java

     
    55import org.sophie2.base.model.book.BookH; 
    66import org.sophie2.base.model.resources.r4.ResourceRefList; 
    77import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     8import org.sophie2.base.skins.Message; 
    89import org.sophie2.main.app.commons.element.ElementDropHandler; 
    910import org.sophie2.main.app.commons.page.RootPageView; 
    1011import org.sophie2.main.dnd.dnddata.ResourceRefData; 
     
    1819 */ 
    1920public class PageReorderHandler extends ElementDropHandler<RootPageView> { 
    2021         
     22        /** 
     23         * Constant created for reordering pages. 
     24         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     25         * Used for skinning. 
     26         */ 
     27        public static final String REORDER_PAGES = "Reorder Pages."; 
    2128        private static PageReorderHandler instance = null; 
    2229         
    2330        private PageReorderHandler() { 
     
    4754                final int dropIndex = book.getIndexOf(getView().model().get().getRef()); 
    4855 
    4956                final ResourceRefList pages = book.getPages(); 
    50                 new AutoAction("Reorder Pages.", true) { 
     57                new AutoAction(Message.create(REORDER_PAGES), true) { 
    5158 
    5259                        @Override 
    5360                        public void performAuto() { 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/element/ElementLogic.java

     
    3232import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    3333import org.sophie2.base.scene.SceneVisual; 
    3434import org.sophie2.base.scene.interfaces.SceneElement; 
     35import org.sophie2.base.skins.Message; 
    3536import org.sophie2.base.visual.VisualElement; 
    3637import org.sophie2.base.visual.interaction.InputEventR3; 
    3738import org.sophie2.base.visual.interaction.InputModifier; 
     
    191192                                final ImmList<ResourceRefR4> finalChildRefs = childRefs; 
    192193                                 
    193194                                final ImmList<ActivationChannel> channels = CompositeElement.KEY_SUB_ELEMENTS.get(fakeParentAccess);     
    194                                 new AutoAction("Paste", true) { 
     195                                new AutoAction(Message.create(PASTE), true) { 
    195196                                        @Override 
    196197                                        public void performAuto() { 
    197198 
     
    228229        }; 
    229230         
    230231        /** 
     232         * Constant created for cut. 
     233         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     234         * Used for skinning. 
     235         */ 
     236        public static final String CUT = "Cut"; 
     237 
     238        /** 
     239         * Constant created for copy. 
     240         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     241         * Used for skinning. 
     242         */ 
     243        public static final String PASTE = "Paste"; 
     244 
     245        /** 
    231246         * Selects the element passed as an argument. 
    232247         *  
    233248         * @param element 
     
    338353                                 
    339354                                ResourceRefList children = this.getResource().getChildren(); 
    340355                                for (ResourceRefR4 child : children) { 
    341                                         parentView.model().get().removeSubElement(child, "Cut", true); 
     356                                        parentView.model().get().removeSubElement(child, Message.create(CUT), true); 
    342357                                }                        
    343358                        } 
    344359                         
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/util/TemplateUtil.java

     
    3131import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    3232import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3333import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     34import org.sophie2.base.skins.Message; 
    3435import org.sophie2.base.visual.VisualElement; 
    3536import org.sophie2.main.app.commons.app.AppMainWindow; 
    3637import org.sophie2.main.app.commons.book.BookView; 
     
    4748 * @author deni 
    4849 */ 
    4950public class TemplateUtil { 
     51         
     52        /** 
     53         * Constant created for applying frame template. 
     54         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     55         * Used for skinning. 
     56         */ 
     57        public static final String APPLYING_FRAME_TEMPLATE = "Applying frame template"; 
     58         
     59        /** 
     60         * Constant created for creating frame for template. 
     61         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     62         * Used for skinning. 
     63         */ 
     64        public static final String CREATE_FRAME_FOR_TEMPLATE = "Create frame for template"; 
     65         
     66        /** 
     67         * Constant created for creating group for template. 
     68         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     69         * Used for skinning. 
     70         */ 
     71        public static final String CREATE_GROUP_FOR_TEMPLATE = "Create group for template"; 
     72         
     73        /** 
     74         * Constant created for applying page template. 
     75         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     76         * Used for skinning. 
     77         */ 
     78        public static final String APPLY_PAGE_TEMPLATE = "Apply page template."; 
     79 
    5080        /** 
    5181         * Creates template element and adds it to the library. 
    5282         *  
     
    111141                 
    112142                //auto-action which changes the keys of the root element/its sub-elements 
    113143                String changeKeysDescription = "Change the template's elements' keys"; 
    114                 new AutoAction(changeKeysDescription, false) { 
     144                new AutoAction(Message.create(changeKeysDescription), false) { 
    115145                        @Override 
    116146                        public void performAuto() { 
    117147                                getChanger().copyResource(relativeRef, templateRef); 
     
    160190                 * Auto-action which deletes the unneeded sub-elements (also removes their activation channels from the  
    161191                 * corresponding parent's KEY_SUB_ELEMENTS key). 
    162192                 */ 
    163                 new AutoAction (description, isSign) { 
     193                new AutoAction (Message.create(description), isSign) { 
    164194                        @Override 
    165195                        public void performAuto () { 
    166196                                ResourceChanger subCh = getChanger().getSub(templateRef); 
     
    321351         * or to make new frames. 
    322352         *  
    323353         * This method registers insignificant changes only. You may want to call  
    324          * {@link AutoAction#registerEndChange(ResourceAccess, String)} to close the group of changes. 
     354         * {@link AutoAction#registerEndChange(ResourceAccess, Message)} to close the group of changes. 
    325355         *  
    326356         * @param page 
    327357         *      The page to apply the template to. 
     
    347377                // template page properties other than page elements 
    348378                final ImmList<TemplatedKey<?>> pageImmKeys = templateH.getApplicableTemplatedKeys(); 
    349379                                 
    350                 new AutoAction("Apply page template.", false) { 
     380                new AutoAction(Message.create(APPLY_PAGE_TEMPLATE), false) { 
    351381                        @Override 
    352382                        public void performAuto() { 
    353383                                ResourceChanger ch = getChanger(); 
     
    411441                final ImmList<ActivationChannel> parentElements =  
    412442                        CompositeElement.KEY_SUB_ELEMENTS.get(parent.getAccess()); 
    413443 
    414                 new AutoAction("Create group for template", false) { 
     444                new AutoAction(Message.create(CREATE_GROUP_FOR_TEMPLATE), false) { 
    415445 
    416446                        @Override 
    417447                        public void performAuto() { 
     
    442472                final ImmList<ActivationChannel> elements =  
    443473                        CompositeElement.KEY_SUB_ELEMENTS.get(parent.getAccess()); 
    444474 
    445                 new AutoAction("Create frame for template", false) { 
     475                new AutoAction(Message.create(CREATE_FRAME_FOR_TEMPLATE), false) { 
    446476                        @Override 
    447477                        public void performAuto() { 
    448478                                ResourceChanger ch = getChanger(); 
     
    468498 
    469499                final ResourceRefR4 targetToTemplateRef =  
    470500                        ResourceRefR4.getRelativeRef(frameRef, templateH.getRef()); 
    471                 new AutoAction("Applying frame template", false) { 
     501                new AutoAction(Message.create(APPLYING_FRAME_TEMPLATE), false) { 
    472502 
    473503                        @Override 
    474504                        public void performAuto() { 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/ShadowHud.java

     
    2020import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2121import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2222import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
     23import org.sophie2.base.skins.Message; 
    2324import org.sophie2.base.skins.SkinElementId; 
    2425import org.sophie2.base.visual.BaseVisualElement; 
    2526import org.sophie2.base.visual.VisualElement; 
     
    332333 
    333334                                System.out.println("point = " + point); 
    334335 
    335                                 new AutoAction("Shadow position X change.", true) { 
     336                                new AutoAction(Message.create(SHADOW_POSITION_X_CHANGE), true) { 
    336337                                        @Override 
    337338                                        public void performAuto() { 
    338339                                                getChanger().setRaw(FrameR4.KEY_SHADOW__POSITION, point); 
     
    360361                                Float x = FrameR4.KEY_SHADOW__POSITION.get(access).getX(); 
    361362                                Float y = BoundValidation.parseNumber(input, Float.class); 
    362363                                final ImmPoint point = new ImmPoint(x, y); 
    363                                 new AutoAction("Shadow position Y change.", true) { 
     364                                new AutoAction(Message.create(SHADOW_POSITION_Y_CHANGE), true) { 
    364365                                        @Override 
    365366                                        public void performAuto() { 
    366367                                                getChanger().setRaw(FrameR4.KEY_SHADOW__POSITION, point); 
     
    387388                                } 
    388389                                final ImmColor input = event.getEventParam( 
    389390                                                ColorPickerHudField.EventIds.COLOR_PARAM_INDEX, ImmColor.class); 
    390                                 new AutoAction("Shadow color change.", true) { 
     391                                new AutoAction(Message.create(SHADOW_COLOR_CHANGE), true) { 
    391392                                        @Override 
    392393                                        public void performAuto() { 
    393394                                                getChanger().setRaw(FrameR4.KEY_SHADOW__COLOR, input); 
     
    421422                                        return false; 
    422423                                } 
    423424 
    424                                 new AutoAction("Change frame shadow opacity", true) { 
     425                                new AutoAction(Message.create(CHANGE_FRAME_SHADOW_OPACITY), true) { 
    425426                                        @Override 
    426427                                        public void performAuto() { 
    427428                                                getChanger().setRaw(FrameR4.KEY_SHADOW__OPACITY, input.floatValue() / 100); 
     
    430431 
    431432                                return true; 
    432433                        } 
    433  
    434                 }, 
     434                }; 
    435435 
     436                /** 
     437                 * Constant created for changing y shadow position . 
     438                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     439                 * Used for skinning. 
     440                 */ 
     441                public static final String SHADOW_POSITION_Y_CHANGE = "Shadow position Y change."; 
     442                 
     443                /** 
     444                 * Constant created for changing x shadow position. 
     445                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     446                 * Used for skinning. 
     447                 */ 
     448                public static final String SHADOW_POSITION_X_CHANGE = "Shadow position X change."; 
     449                 
     450                /** 
     451                 * Constant created for changing shadow color. 
     452                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     453                 * Used for skinning. 
     454                 */ 
     455                public static final String SHADOW_COLOR_CHANGE = "Shadow color change."; 
     456                 
     457                /** 
     458                 * Constant created for changing frame shadow opacity. 
     459                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     460                 * Used for skinning. 
     461                 */ 
     462                public static final String CHANGE_FRAME_SHADOW_OPACITY = "Change frame shadow opacity"; 
    436463        } 
    437464 
    438465        /** 
  • modules/org.sophie2.server.webui/src/main/java/org/sophie2/server/webui/handlers/ForgottenPasswordHandler.java

     
    4040public class ForgottenPasswordHandler extends BaseHandlerSupport { 
    4141 
    4242        /** 
     43         * Constant created for changing password. 
     44         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     45         * Used for skinning. 
     46         */ 
     47        public static final String CHANGE_PASS = "Change pass"; 
     48 
     49        /** 
    4350         * The serial version UID of this class. 
    4451         */ 
    4552        private static final long serialVersionUID = 4911464333502576011L; 
     
    108115                                        navigator.redirectToReferrer(4, COULD_NOT_SEND_MESSAGE); 
    109116                                } 
    110117                                 
    111                                 new AutoAction("Change pass", true) { 
     118                                new AutoAction(org.sophie2.base.skins.Message.create(CHANGE_PASS), true) { 
    112119 
    113120                                        @Override 
    114121                                        public void performAuto() { 
  • modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/logic/ChangeFrameMainResourceHandler.java

     
    88import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    99import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1010import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     11import org.sophie2.base.skins.Message; 
    1112import org.sophie2.core.mvc.LogicR3; 
    1213import org.sophie2.main.app.commons.book.BookDocView; 
    1314import org.sophie2.main.app.commons.book.BookView; 
     
    2627 */ 
    2728public class ChangeFrameMainResourceHandler extends ElementDropHandler<FrameView> { 
    2829 
     30        /** 
     31         * Constant created for changing the main resource od a frame. 
     32         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     33         * Used for skinning. 
     34         */ 
     35        public static final String MAIN_RESOURCE_OF_FRAME = "Change the main resource of a frame"; 
    2936        private static ChangeFrameMainResourceHandler instance = null; 
    3037         
    3138        private ChangeFrameMainResourceHandler() { 
     
    8188                LogicR3.fire(getView(), bdw, null, null, BookView.EventIds.DELETING_ELEMENT, 
    8289                                ResourceDeleteLogic.findElementView(bookToFrameRef, getView().getBookView())); 
    8390                 
    84                 new AutoAction("Change the main resource of a frame", true) { 
     91                new AutoAction(Message.create(MAIN_RESOURCE_OF_FRAME), true) { 
    8592                         
    8693                        @Override 
    8794                        public void performAuto() { 
  • modules/org.sophie2.dev/src/test/java/org/sophie2/dev/author/ResourcePreviewSystemTest.java

     
    1919import org.sophie2.base.scene.BaseSceneModule; 
    2020import org.sophie2.base.skins.BaseSkinPart; 
    2121import org.sophie2.base.skins.BaseSkinsModule; 
     22import org.sophie2.base.skins.Message; 
    2223import org.sophie2.base.skins.SkinUtil; 
    2324import org.sophie2.base.visual.AutoVisualProvider; 
    2425import org.sophie2.base.visual.BaseSwingVisualElement; 
     
    5960public class ResourcePreviewSystemTest extends SystemTestBase { 
    6061 
    6162        /** 
     63         * Constant created for creation of an image frame. 
     64         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     65         * Used for skinning. Used in the test. 
     66         */ 
     67        public static final String CREATING_DUMMY_RESOURCE = "Creating dummy resource."; 
     68 
     69        /** 
    6270         * Dummy module for testing. 
    6371         *  
    6472         * @author tanya 
     
    282290                final ResourceRefR4 dummyRef =  
    283291                        ResourceRefR4.generateRandomSub(DummyResourceH.NAME_PREFIX); 
    284292                 
    285                 new AutoAction("Creating dummy resource.", true) { 
     293                new AutoAction(Message.create(CREATING_DUMMY_RESOURCE), true) { 
    286294                        @Override 
    287295                        public void performAuto() { 
    288296                                getChanger().makeResource(dummyRef); 
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/ElementH.java

     
    3232import org.sophie2.base.model.resources.r4.resources.RedirectR4; 
    3333import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3434import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     35import org.sophie2.base.skins.Message; 
    3536import org.sophie2.core.logging.SophieLog; 
    3637import org.sophie2.core.prolib.impl.AutoProperty; 
    3738import org.sophie2.core.prolib.interfaces.Prop; 
     
    411412         *            The significance of the action. 
    412413         */ 
    413414        public void removeSubElement(final ResourceRefR4 element, 
    414                         String actionName, boolean significance) { 
     415                        Message actionName, boolean significance) { 
    415416 
    416417                ResourceAccess access = getAccess(); 
    417418                final ImmList<ActivationChannel> children = CompositeElement.KEY_SUB_ELEMENTS 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/util/DeletePageUtil.java

     
    66import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    77import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    88import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     9import org.sophie2.base.skins.Message; 
    910import org.sophie2.core.mvc.LogicR3; 
    1011import org.sophie2.main.app.commons.book.BookDocView; 
    1112import org.sophie2.main.app.commons.book.BookView; 
     
    2021public class DeletePageUtil { 
    2122         
    2223        /** 
     24         * Constant created for removing a page. 
     25         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     26         * Used for skinning. 
     27         */ 
     28        public static final String REMOVE_PAGE = "Remove page"; 
     29 
     30        /** 
    2331         * Method that removes a page from the model of the book and  
    2432         * moves the current page to the next/previous one.  
    2533         *  
     
    6674                LogicR3.fire(bdw, bdw, null, null,  
    6775                                BookView.EventIds.DELETING_ELEMENT, pageViewToDel); 
    6876 
    69                 new AutoAction("Remove page", isSign) { 
     77                new AutoAction(Message.create(REMOVE_PAGE), isSign) { 
    7078 
    7179                        @Override 
    7280                        public void performAuto() {                                              
  • modules/org.sophie2.main.func.links/src/main/java/org/sophie2/main/func/links/LinksUtil.java

     
    66import org.sophie2.base.model.book.links.LinkAction; 
    77import org.sophie2.base.model.book.links.LinkRule; 
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     9import org.sophie2.base.skins.Message; 
    910import org.sophie2.core.mvc.LogicR3; 
    1011import org.sophie2.main.app.commons.links.LinkHolder; 
    1112import org.sophie2.main.func.links.LinksHudLogic.EventIds; 
     
    1617 * @author mira 
    1718 */ 
    1819public class LinksUtil { 
     20         
     21        /** 
     22         * Constant created for changing link action settings. 
     23         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     24         * Used for skinning. 
     25         */ 
     26        public static final String CHANGE_LINK_ACTION_SETTINGS = "Change link action settings"; 
     27 
    1928        /** 
    2029         * Performs the {@link AutoAction} that modifies the model. 
    2130         *   
     
    4352                final Link newLink = new Link(newRules); 
    4453 
    4554                LogicR3.fire(hud, null, null, null, EventIds.SET_LINK,  
    46                                 newLink, "Change link action settings"); 
     55                                newLink, Message.create(CHANGE_LINK_ACTION_SETTINGS)); 
    4756                 
    4857                hud.wantedRule().set(newRule); 
    4958        } 
  • modules/org.sophie2.extra.func.annotations/src/test/java/org/sophie2/extra/func/annotations/persistence/BookExtraPersistenceTest.java

     
    3434import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    3535import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    3636import org.sophie2.base.persistence.BasePersistenceModule; 
     37import org.sophie2.base.skins.Message; 
    3738import org.sophie2.core.modularity.FakeModuleRegistry; 
    3839import org.sophie2.core.testing.IntegrationTestBase; 
    3940import org.sophie2.extra.func.annotations.AnnotationsModule; 
     
    4647 */ 
    4748public class BookExtraPersistenceTest extends IntegrationTestBase { 
    4849 
     50        /** 
     51         * Constant created for creating a book extra with two stickies.  
     52         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     53         * Used for skinning. Used in the test. 
     54         */ 
     55        public static final String CREATE_EXTRA_WITH_TWO_STICKIES = "Create a book extra with two stickies"; 
     56         
     57        /** 
     58         * Constant created for creating an empty book.  
     59         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     60         * Used for skinning. Used in the test. 
     61         */ 
     62        public static final String CREATE_EMPTY_BOOK = "Create an empty book"; 
    4963        private ResourceAccess bookAccess; 
    5064        private ResourceAccess access; 
    5165         
     
    7084                final ResourceRefR4 ref = ResourceRefR4.make(location); 
    7185                this.bookAccess = locator.create(ref, AccessOptions.DEFAULT_ACCESS_OPTIONS, head); 
    7286                 
    73                 new AutoAction("Create an empty book", false) { 
     87                new AutoAction(Message.create(CREATE_EMPTY_BOOK), false) { 
    7488                        @Override 
    7589                        public void performAuto() { 
    7690                                getChanger().setRaw(ResourceR4.KEY_KIND, BookR4.KIND); 
     
    88102                this.access = locator.create(extraRef, AccessOptions.DEFAULT_ACCESS_OPTIONS, extraHead); 
    89103                 
    90104                // Create a book with two stickies 
    91                 new AutoAction("Create a book extra with two stickies", false) { 
     105                new AutoAction(Message.create(CREATE_EXTRA_WITH_TWO_STICKIES), false) { 
    92106                        @Override 
    93107                        public void performAuto() { 
    94108                                getChanger().setRaw(ResourceR4.KEY_KIND, BookExtraR4.KIND); 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/access/mem/MemAccessTest.java

     
    1010import org.sophie2.base.model.resources.r4.changes.SubResourceChanger; 
    1111import org.sophie2.base.model.resources.r4.dummies.resources.DummyResource; 
    1212import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     13import org.sophie2.base.skins.Message; 
    1314import org.sophie2.core.testing.UnitTestBase; 
    1415 
    1516/** 
     
    4748                assertNotNull(asteaAccess); 
    4849                String asteaComment = "The company!!!"; 
    4950                String changeDescription = "Initializing the Astea resource";            
    50                 initializeResource(asteaAccess, asteaComment, changeDescription); 
     51                initializeResource(asteaAccess, asteaComment, Message.create(changeDescription)); 
    5152 
    5253                assertEquals(changeDescription, 
    5354                                asteaAccess.getHead().getLastChange().getDescription()); 
     
    7172         *                      The initial change description. 
    7273         */ 
    7374        public static void initializeResource(ResourceAccess access,  
    74                         final String asteaComment, String changeDescription) { 
     75                        final String asteaComment, Message changeDescription) { 
    7576                new AutoAction(changeDescription, true) { 
    7677                        @Override 
    7778                        public void performAuto() { 
  • modules/org.sophie2.dev/src/test/java/org/sophie2/dev/author/TextChainingSystemTest.java

     
    1515import org.sophie2.base.menus.MenuItem; 
    1616import org.sophie2.base.model.book.FrameH; 
    1717import org.sophie2.base.model.resources.r4.ResourceRefR4; 
     18import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1819import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1920import org.sophie2.base.model.text.smart.ImmHotText; 
    2021import org.sophie2.base.scene.BaseSceneModule; 
    2122import org.sophie2.base.skins.BaseSkinsModule; 
     23import org.sophie2.base.skins.Message; 
    2224import org.sophie2.base.visual.BaseVisualModule; 
    2325import org.sophie2.core.modularity.SophieModule; 
    2426import org.sophie2.core.mvc.CoreMvcModule; 
     
    5658@SystemTest 
    5759public class TextChainingSystemTest extends SystemTestBase { 
    5860 
     61        /** 
     62         * Constant created for insertion of a full text frame. 
     63         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     64         * Used for skinning. Used in the test. 
     65         */ 
     66        public static final String INSERT_FULL_TEXT_FRAME = "Insert a full text frame"; 
    5967        private final static int FRAMES_TO_INSERT = 4; 
    6068        private final static int SELECTED_FRAME = 0; 
    6169        private final static int FIRST_FRAME_TO_CHAIN = 1; 
     
    234242                 
    235243                HeadTextFrameH.createTextFrameAction(curBook(), 
    236244                                curPageWorkArea().getRootPageView().model().get(), 
    237                                 text, ResourceRefR4.NONE_REF.toUri(), null, "Insert a full text frame", true); 
     245                                text, ResourceRefR4.NONE_REF.toUri(), null, Message.create(INSERT_FULL_TEXT_FRAME), true); 
    238246                 
    239247                TextFrameView frameViewToSelect = 
    240248                        curPageWorkArea().getAll(TextFrameView.class).get(4); 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/keys/TemplateIntegrationTest.java

     
    1818import org.sophie2.base.model.resources.r4.dummies.resources.DummyPage; 
    1919import org.sophie2.base.model.resources.r4.dummies.resources.StyledDummyResource; 
    2020import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.core.logging.LogLevel; 
    2223import org.sophie2.core.logging.SophieLog; 
    2324import org.sophie2.core.modularity.FakeModuleRegistry; 
     
    3031 */ 
    3132public class TemplateIntegrationTest extends UnitTestBase { 
    3233 
     34        /** 
     35         * Constant created for setting border size to frame 1. 
     36         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     37         * Used for skinning. Used in the test. 
     38         */ 
     39        public static final String SETTING_BORDER_SIZE_TO_FRAME_1 = "setting border size to frame 1"; 
     40         
     41        /** 
     42         * Constant created for setting border size to frame 2. 
     43         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     44         * Used for skinning. Used in the test. 
     45         */ 
     46        public static final String SETTING_BORDER_SIZE_TO_FRAME_2 = "setting border size to frame 2"; 
     47         
     48        /** 
     49         * Constant created for setting border size to frame 3. 
     50         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     51         * Used for skinning. Used in the test. 
     52         */ 
     53        public static final String SETTING_BORDER_SIZE_TO_FRAME_3 = "setting border size to frame 3"; 
     54         
     55        /** 
     56         * Constant created for applying template to frame 2. 
     57         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     58         * Used for skinning. Used in the test. 
     59         */ 
     60        public static final String APPLYING_TEMPLATE_TO_FRAME_2 = "applying template to frame 2"; 
     61         
     62        /** 
     63         * Constant created for applying template to frame 1. 
     64         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     65         * Used for skinning. Used in the test. 
     66         */ 
     67        public static final String APPLYING_TEMPLATE_TO_FRAME_1 = "applying template to frame 1"; 
     68         
     69        /** 
     70         * Constant created for creating frame 3. 
     71         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     72         * Used for skinning. Used in the test. 
     73         */ 
     74        public static final String FRAME_3_CREATED = "frame 3 created"; 
     75         
     76        /** 
     77         * Constant created for creating frame 2. 
     78         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     79         * Used for skinning. Used in the test. 
     80         */ 
     81        public static final String FRAME_2_CREATED = "frame 2 created"; 
     82         
     83        /** 
     84         * Constant created for creating frame 1. 
     85         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     86         * Used for skinning. Used in the test. 
     87         */ 
     88        public static final String FRAME_1_CREATED = "frame 1 created"; 
     89         
     90        /** 
     91         * Constant created for removing page border color. 
     92         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     93         * Used for skinning. Used in the test. 
     94         */ 
     95        public static final String REMOVING_PAGE_BORDER_COLOR = "removing page border color"; 
     96         
     97        /** 
     98         * Constant created for applying template to page. 
     99         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     100         * Used for skinning. Used in the test. 
     101         */ 
     102        public static final String APPLYING_TEMPLATE_TO_PAGE = "applying template to page"; 
     103         
     104        /** 
     105         * Constant created for setting page template border. 
     106         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     107         * Used for skinning. Used in the test. 
     108         */ 
     109        public static final String SET_PAGE_TEMPLATE_BORDER = "set page template border"; 
     110         
     111        /** 
     112         * Constant created for setting page border color. 
     113         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     114         * Used for skinning. Used in the test. 
     115         */ 
     116        public static final String SET_PAGE_BORDER_COLOR = "set page border color"; 
     117 
     118        /** 
     119         * Constant created for creating a template. 
     120         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     121         * Used for skinning. Used in the test. 
     122         */ 
     123        public static final String TEMPLATE_CREATED = "template created"; 
     124         
     125        /** 
     126         * Constant created for creating page. 
     127         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     128         * Used for skinning. Used in the test. 
     129         */ 
     130        public static final String PAGE_CREATED = "page created"; 
    33131        private ResourceAccess access; 
    34132 
    35133        @SuppressWarnings("unchecked") 
     
    71169                final ResourceRefR4 page = ResourceRefR4.makeChild("page"); 
    72170                final ResourceRefR4 template = ResourceRefR4.makeChild("template"); 
    73171 
    74                 new AutoAction("page created", true) { 
     172                new AutoAction(Message.create(PAGE_CREATED), true) { 
    75173                        @Override 
    76174                        public void performAuto() { 
    77175                                getChanger().makeResource(page); 
     
    79177                        } 
    80178                }.register(this.access); 
    81179 
    82                 new AutoAction("template created", true) { 
     180                new AutoAction(Message.create(TEMPLATE_CREATED), true) { 
    83181                        @Override 
    84182                        public void performAuto() { 
    85183                                getChanger().makeResource(template); 
     
    95193                assertEquals(StyledDummyResource.DEFAULT_BORDER_COLOR, 
    96194                                StyledDummyResource.KEY_BORDER__COLOR.get(pageAccess)); 
    97195 
    98                 new AutoAction("set page border color", true) { 
     196                new AutoAction(Message.create(SET_PAGE_BORDER_COLOR), true) { 
    99197                        @Override 
    100198                        public void performAuto() { 
    101199                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__COLOR, 
     
    106204                assertEquals(ImmColor.PINK, StyledDummyResource.KEY_BORDER__COLOR 
    107205                                .get(pageAccess)); 
    108206 
    109                 new AutoAction("set page template border", true) { 
     207                new AutoAction(Message.create(SET_PAGE_TEMPLATE_BORDER), true) { 
    110208                        @Override 
    111209                        public void performAuto() { 
    112210                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__SIZE, 10.0); 
     
    121219                                .get(templateAccess)); 
    122220 
    123221                final ResourceRefR4 absoluteTemplateRef = templateAccess.getRef(); 
    124                 new AutoAction("applying template to page", true) { 
     222                new AutoAction(Message.create(APPLYING_TEMPLATE_TO_PAGE), true) { 
    125223                        @Override 
    126224                        public void performAuto() { 
    127225                                getChanger().setRaw(ResourceR4.KEY_TEMPLATE, 
     
    133231                assertEquals(ImmColor.PINK, StyledDummyResource.KEY_BORDER__COLOR 
    134232                                .get(pageAccess)); 
    135233 
    136                 new AutoAction("removing page border color", true) { 
     234                new AutoAction(Message.create(REMOVING_PAGE_BORDER_COLOR), true) { 
    137235                        @Override 
    138236                        public void performAuto() { 
    139237                                getChanger() 
     
    145243                assertEquals(ImmColor.GREEN, StyledDummyResource.KEY_BORDER__COLOR 
    146244                                .get(pageAccess)); 
    147245 
    148                 new AutoAction("set page template border", true) { 
     246                new AutoAction(Message.create(SET_PAGE_TEMPLATE_BORDER), true) { 
    149247                        @Override 
    150248                        public void performAuto() { 
    151249                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__SIZE, 20.0); 
     
    171269                final ResourceRefR4 frame2 = ResourceRefR4.makeChild("frame2"); 
    172270                final ResourceRefR4 frame3 = ResourceRefR4.makeChild("frame3"); 
    173271 
    174                 new AutoAction("frame 1 created", true) { 
     272                new AutoAction(Message.create(FRAME_1_CREATED), true) { 
    175273                        @Override 
    176274                        public void performAuto() { 
    177275                                getChanger().makeResource(frame1); 
     
    179277                        } 
    180278                }.register(this.access); 
    181279 
    182                 new AutoAction("frame 2 created", true) { 
     280                new AutoAction(Message.create(FRAME_2_CREATED), true) { 
    183281                        @Override 
    184282                        public void performAuto() { 
    185283                                getChanger().makeResource(frame2); 
     
    187285                        } 
    188286                }.register(this.access); 
    189287 
    190                 new AutoAction("frame 3 created", true) { 
     288                new AutoAction(Message.create(FRAME_3_CREATED), true) { 
    191289                        @Override 
    192290                        public void performAuto() { 
    193291                                getChanger().makeResource(frame3); 
     
    205303                assertEquals(StyledDummyResource.DEFAULT_BORDER_SIZE, 
    206304                                StyledDummyResource.KEY_BORDER__SIZE.get(frameAccess1)); 
    207305 
    208                 new AutoAction("applying template to frame 1", true) { 
     306                new AutoAction(Message.create(APPLYING_TEMPLATE_TO_FRAME_1), true) { 
    209307                        @Override 
    210308                        public void performAuto() { 
    211309                                getChanger().setRaw(ResourceR4.KEY_TEMPLATE, absoluteRef2); 
    212310                        } 
    213311                }.register(frameAccess1); 
    214312 
    215                 new AutoAction("applying template to frame 2", true) { 
     313                new AutoAction(Message.create(APPLYING_TEMPLATE_TO_FRAME_2), true) { 
    216314                        @Override 
    217315                        public void performAuto() { 
    218316                                getChanger().setRaw(ResourceR4.KEY_TEMPLATE, absoluteRef3); 
     
    226324                assertEquals(StyledDummyResource.DEFAULT_BORDER_SIZE, 
    227325                                StyledDummyResource.KEY_BORDER__SIZE.get(frameAccess3)); 
    228326 
    229                 new AutoAction("setting border size to frame 3", true) { 
     327                new AutoAction(Message.create(SETTING_BORDER_SIZE_TO_FRAME_3), true) { 
    230328                        @Override 
    231329                        public void performAuto() { 
    232330                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__SIZE, 3.0); 
     
    240338                assertEquals(3.0, StyledDummyResource.KEY_BORDER__SIZE 
    241339                                .get(frameAccess3)); 
    242340 
    243                 new AutoAction("setting border size to frame 2", true) { 
     341                new AutoAction(Message.create(SETTING_BORDER_SIZE_TO_FRAME_2), true) { 
    244342                        @Override 
    245343                        public void performAuto() { 
    246344                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__SIZE, 2.0); 
     
    254352                assertEquals(3.0, StyledDummyResource.KEY_BORDER__SIZE 
    255353                                .get(frameAccess3)); 
    256354 
    257                 new AutoAction("setting border size to frame 1", true) { 
     355                new AutoAction(Message.create(SETTING_BORDER_SIZE_TO_FRAME_1), true) { 
    258356                        @Override 
    259357                        public void performAuto() { 
    260358                                getChanger().setRaw(StyledDummyResource.KEY_BORDER__SIZE, 1.0); 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/frame/FrameLogic.java

     
    2121import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
    2222import org.sophie2.base.scene.SceneVisual; 
    2323import org.sophie2.base.scene.helpers.SceneHelper; 
     24import org.sophie2.base.skins.Message; 
    2425import org.sophie2.base.visual.interaction.InputEventR3; 
    2526import org.sophie2.core.mvc.EventFilterBuilder; 
    2627import org.sophie2.core.mvc.OperationDef; 
     
    8485                        new MouseCapture(0, 0, cause) { 
    8586                                @Override 
    8687                                public void released() { 
    87                                         AutoAction.registerEndChange(access, "Resize frame finished."); 
     88                                        AutoAction.registerEndChange(access, Message.create(RESIZE_FRAME_FINISHED)); 
    8889                                        sv.wantedViewRect().set(null); 
    8990                                } 
    9091 
     
    9293                                                final ImmPoint newLocationInPage, final ImmSize newSize) { 
    9394                                        TimePos time = elementView.getTime(); 
    9495                                        final LocationChannel newChannel = oldChannel.setValue(time, newLocationInPage); 
    95                                         new AutoAction("Frame resize", false) { 
     96                                        new AutoAction(Message.create(FRAME_RESIZE), false) { 
    9697                                                @Override 
    9798                                                public void performAuto() { 
    9899                                                        ResourceChanger ch = getChanger(); 
     
    185186                } 
    186187 
    187188        }; 
     189 
     190        /** 
     191         * Constant created for expressing that frame resize is finished. 
     192         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     193         * Used for skinning. 
     194         */ 
     195        public static final String RESIZE_FRAME_FINISHED = "Resize frame finished."; 
     196         
     197        /** 
     198         * Constant created for expressing that frame is resized. 
     199         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     200         * Used for skinning. 
     201         */ 
     202        public static final String FRAME_RESIZE = "Frame resize"; 
    188203} 
     204 No newline at end of file 
  • modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/page/PageTemplateLogic.java

     
    1717import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1818import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1919import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     20import org.sophie2.base.skins.Message; 
    2021import org.sophie2.core.logging.SophieLog; 
    2122import org.sophie2.core.modularity.SortKey; 
    2223import org.sophie2.core.mvc.EventFilterBuilder; 
     
    322323                        String pageTitle = ResourceR4.KEY_TITLE.get(bookDocView.getAccess().open(template, null)); 
    323324 
    324325                        if (TemplatePaletteUtil.confirmDeletion(pageTitle, bookDocView.swingComponent().get())) { 
    325                                 new AutoAction("Delete page template", true) { 
     326                                new AutoAction(Message.create(DELETE_PAGE_TEMPLATE), true) { 
    326327 
    327328                                        @Override 
    328329                                        public void performAuto() { 
     
    339340 
    340341        }; 
    341342 
     343        /** 
     344         * Constant created for deleting a page template. 
     345         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     346         * Used for skinning. 
     347         */ 
     348        public static final String DELETE_PAGE_TEMPLATE = "Delete page template"; 
    342349} 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/BookUnitTest.java

     
    2424import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2525import org.sophie2.base.model.resources.r4.changes.SubResourceChanger; 
    2626import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     27import org.sophie2.base.skins.Message; 
    2728 
    2829/** 
    2930 * Unit test for {@link BookH}. 
     
    3233 */ 
    3334public class BookUnitTest extends ModelTestBase { 
    3435 
     36        /** 
     37         * Constant created for modifying copied book. 
     38         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     39         * Used for skinning. Used in the test. 
     40         */ 
     41        public static final String MODIFY_COPIED_BOOK = "Modify the copied book"; 
     42         
     43        /** 
     44         * Constant created for creating a new page with 2 image frames in a group. 
     45         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     46         * Used for skinning. Used in the test. 
     47         */ 
     48        public static final String CREATE_PAGE_WITH_IMAGE_FRAMES_IN_GROUP = "Create a new page with 2 image frames in a group"; 
     49         
     50        /** 
     51         * Constant created for clearing pages. 
     52         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     53         * Used for skinning. Used in the test. 
     54         */ 
     55        public static final String CLEAR_PAGES = "clear pages"; 
     56         
     57        /** 
     58         * Constant created for moving pages. 
     59         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     60         * Used for skinning. Used in the test. 
     61         */ 
     62        public static final String MOVE_PAGES = "move pages"; 
     63         
     64        /** 
     65         * Constant created for creating pages. 
     66         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     67         * Used for skinning. Used in the test. 
     68         */ 
     69        public static final String CREATE_PAGES = "Create pages."; 
     70         
     71        /** 
     72         * Constant created for adding pages. 
     73         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     74         * Used for skinning. Used in the test. 
     75         */ 
     76        public static final String ADD_PAGES = "Adding new pages"; 
    3577        private BookH book; 
    3678 
    3779        @Override 
     
    63105                        ResourceRefR4.generateRandomSub(PageH.NAME_PREFIX);              
    64106                final ResourceRefList pages = this.book.get(BookR4.KEY_PAGES); 
    65107                 
    66                 new AutoAction("Adding new pages", true) { 
     108                new AutoAction(Message.create(ADD_PAGES), true) { 
    67109                        @Override 
    68110                        public void performAuto() { 
    69111                                BookH.addNewPage(getChanger(), pageRef1, pages, PageR4.DEFAULT_TITLE); 
     
    86128                ResourceRefR4 page3 = ResourceRefR4.generateRandomSub("Page"); 
    87129                final ResourceRefList pages = ResourceRefList.create(page1, page2, page3); 
    88130                 
    89                 new AutoAction("Create pages.", false) { 
     131                new AutoAction(Message.create(CREATE_PAGES), false) { 
    90132                         
    91133                        @Override 
    92134                        public void performAuto() { 
     
    101143 
    102144                final ResourceRefList children = this.book.getPages(); 
    103145                // move page 0 to last position and re-check indices 
    104                 new AutoAction("move pages", false) { 
     146                new AutoAction(Message.create(MOVE_PAGES), false) { 
    105147                         
    106148                        @Override 
    107149                        public void performAuto() { 
     
    116158                // return the indices to their initial order and re-check 
    117159                // move page 0 to last position and re-check indices 
    118160                final ResourceRefList children2 = this.book.getPages(); 
    119                 new AutoAction("move pages", false) { 
     161                new AutoAction(Message.create(MOVE_PAGES), false) { 
    120162                         
    121163                        @Override 
    122164                        public void performAuto() { 
     
    128170                assertEquals(1, this.book.getIndexOf(page2)); 
    129171                assertEquals(2, this.book.getIndexOf(page3)); 
    130172                 
    131                 new AutoAction("clear pages", false) { 
     173                new AutoAction(Message.create(CLEAR_PAGES), false) { 
    132174                         
    133175                        @Override 
    134176                        public void performAuto() { 
     
    157199                final ImmList<ActivationChannel> children =  
    158200                        CompositeElement.KEY_SUB_ELEMENTS.get(pageAccess); 
    159201                 
    160                 new AutoAction("Create a new page with 2 image frames in a group", true) { 
     202                new AutoAction(Message.create(CREATE_PAGE_WITH_IMAGE_FRAMES_IN_GROUP), true) { 
    161203                         
    162204                        @Override 
    163205                        public void performAuto() { 
     
    201243                                clone.getAccess().getHead().getModel()); 
    202244                assertNotSame(this.book, clone); 
    203245                 
    204                 new AutoAction("Modify the copied book", true) { 
     246                new AutoAction(Message.create(MODIFY_COPIED_BOOK), true) { 
    205247                         
    206248                        @Override 
    207249                        public void performAuto() { 
  • modules/org.sophie2.main.func.resources/src/test/java/org/sophie2/main/func/resources/dummy/ColdTextResourceHelper.java

     
    66import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    77import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    88import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     9import org.sophie2.base.skins.Message; 
    910 
    1011/** 
    1112 * The helper of our cold text... 
     
    1516public class ColdTextResourceHelper extends ResourceH { 
    1617 
    1718        /** 
     19         * Constant created for creating cold text. 
     20         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     21         * Used for skinning. 
     22         */ 
     23        public static final String CREATING_COLD_TEXT = "Creating cold text"; 
     24        /** 
    1825         * The prefix of the name of this resource. 
    1926         */ 
    2027        @SuppressWarnings("hiding") 
     
    7582                final ResourceRefR4 coldRef =  
    7683                        ResourceRefR4.generateRandomSub(ColdTextResource.DEFAULT_TITLE); 
    7784                 
    78                 new AutoAction("Creating cold text", true) { 
     85                new AutoAction(Message.create(CREATING_COLD_TEXT), true) { 
    7986                        @Override 
    8087                        public void performAuto() { 
    8188                                ColdTextResourceHelper.createColdText( 
  • modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/frame/CreateFrameByTemplateHandler.java

     
    1616import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    1717import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1818import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.main.app.commons.element.ElementDropHandler; 
    2021import org.sophie2.main.app.commons.page.MainPageView; 
    2122import org.sophie2.main.app.commons.util.TemplateUtil; 
     
    2930 */ 
    3031public class CreateFrameByTemplateHandler extends ElementDropHandler<MainPageView> { 
    3132         
     33        /** 
     34         * Constant created for creating a frame from a template.  
     35         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     36         * Used for skinning. 
     37         */ 
     38        public static final String CREATE_FRAME_FROM_TEMPLATE = "Create a frame from a template."; 
    3239        private static CreateFrameByTemplateHandler instance = null; 
    3340         
    3441        private CreateFrameByTemplateHandler() { 
     
    7380                        CompositeElement.KEY_SUB_ELEMENTS.get(parentAccess); 
    7481                 
    7582                final ImmPoint pos = getPoint(); 
    76                 new AutoAction("Create a frame from a template.", true) { 
     83                new AutoAction(Message.create(CREATE_FRAME_FROM_TEMPLATE), true) { 
    7784                        @Override 
    7885                        public void performAuto() { 
    7986                                ResourceChanger changer = getChanger(); 
  • modules/org.sophie2.extra.func.embedded/src/main/java/org/sophie2/extra/func/embedded/view/EmbeddedBooksHud.java

     
    1515import org.sophie2.base.layout.LogicR3ToggleButton; 
    1616import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1717import org.sophie2.base.model.resources.r4.keys.Key; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.base.skins.SkinElementId; 
    1920import org.sophie2.base.visual.skins.ElementSkinPart; 
    2021import org.sophie2.base.visual.skins.RelatedChildren; 
     
    121122        @VisualElementDef(parent = EmbeddedBooksHud.class, sortKey = "bbb-show-prev-page-button") 
    122123        public static class ShowPrevPageButton extends LogicR3ToggleButton { 
    123124                 
     125                /** 
     126                 * Constant created for notifying that 'Prev page' button showed. 
     127                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     128                 * Used for skinning. 
     129                 */ 
     130                public static final String SHOW_PREV_PAGE_BUTTON = "Show 'Prev page' button"; 
     131                 
     132                /** 
     133                 * Constant created for notifying that 'Prev page' button hid.  
     134                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     135                 * Used for skinning. 
     136                 */ 
     137                public static final String HIDE_PREV_PAGE_BUTTON = "Hide 'Prev page' button"; 
     138 
    124139                @SuppressWarnings("unused") 
    125140                @SkinPartDef 
    126141                private static void initSkin(ElementSkinPart part) { 
     
    150165                protected ImmList<EventR3> computeDeselectedEvents() { 
    151166                        return ImmTreeList.<EventR3>create(new EventR3( 
    152167                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    153                                         EmbeddedBookFrameR4.KEY_SHOW_PREV_PAGE, "Hide 'Prev page' button", false)); 
     168                                        EmbeddedBookFrameR4.KEY_SHOW_PREV_PAGE, Message.create(HIDE_PREV_PAGE_BUTTON), false)); 
    154169                } 
    155170 
    156171                @Override 
    157172                protected ImmList<EventR3> computeSelectedEvents() { 
    158173                        return ImmTreeList.<EventR3>create(new EventR3( 
    159174                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    160                                         EmbeddedBookFrameR4.KEY_SHOW_PREV_PAGE, "Show 'Prev page' button", true)); 
     175                                        EmbeddedBookFrameR4.KEY_SHOW_PREV_PAGE, Message.create(SHOW_PREV_PAGE_BUTTON), true)); 
    161176                } 
    162177        } 
    163178         
     
    169184        @VisualElementDef(parent = EmbeddedBooksHud.class, sortKey = "ccc-show-next-page-button") 
    170185        public static class ShowNextPageButton extends LogicR3ToggleButton { 
    171186                 
     187                /** 
     188                 * Constant created for notifying that 'Next page' button showed. 
     189                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     190                 * Used for skinning. 
     191                 */ 
     192                public static final String SHOW_NEXT_PAGE_BUTTON = "Show 'Next page' button"; 
     193                 
     194                /** 
     195                 * Constant created for notifying that 'Next page' button hid. 
     196                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     197                 * Used for skinning. 
     198                 */ 
     199                public static final String HIDE_NEXT_PAGE_BUTTON = "Hide 'Next page' button"; 
     200 
    172201                @SuppressWarnings("unused") 
    173202                @SkinPartDef 
    174203                private static void initSkin(ElementSkinPart part) { 
     
    198227                protected ImmList<EventR3> computeDeselectedEvents() { 
    199228                        return ImmTreeList.<EventR3>create(new EventR3( 
    200229                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    201                                         EmbeddedBookFrameR4.KEY_SHOW_NEXT_PAGE, "Hide 'Next page' button", false)); 
     230                                        EmbeddedBookFrameR4.KEY_SHOW_NEXT_PAGE, Message.create(HIDE_NEXT_PAGE_BUTTON), false)); 
    202231                } 
    203232 
    204233                @Override 
    205234                protected ImmList<EventR3> computeSelectedEvents() { 
    206235                        return ImmTreeList.<EventR3>create(new EventR3( 
    207236                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    208                                         EmbeddedBookFrameR4.KEY_SHOW_NEXT_PAGE, "Show 'Next page' button", true)); 
     237                                        EmbeddedBookFrameR4.KEY_SHOW_NEXT_PAGE, Message.create(SHOW_NEXT_PAGE_BUTTON), true)); 
    209238                } 
    210239        } 
    211240         
     
    225254                 * be registered. The third parameter determines whether the control should be shown 
    226255                 * or hidden. 
    227256                 */ 
    228                 @EventParams({ Key.class, String.class, Boolean.class }) 
     257                @EventParams({ Key.class, Message.class, Boolean.class }) 
    229258                TOGGLE_CONTROL; 
    230259                 
    231260                /** 
     
    270299                                // suppressing warnings because we need to set a key's value 
    271300                                final Key<Boolean> key = event.getEventParam( 
    272301                                                EmbeddedBooksHud.EventIds.KEY_PARAM_INDEX, Key.class); 
    273                                 String description = event.getEventParam( 
    274                                                 EmbeddedBooksHud.EventIds.DESCR_PARAM_INDEX, String.class); 
     302                                Message description = event.getEventParam( 
     303                                                EmbeddedBooksHud.EventIds.DESCR_PARAM_INDEX, Message.class); 
    275304                                final boolean shown = event.getEventParam( 
    276305                                                EmbeddedBooksHud.EventIds.VISIBLE_PARAM_INDEX, Boolean.class); 
    277306                                 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/rotate/FrameRotateHaloButton.java

     
    1818import org.sophie2.base.scene.SceneVisual; 
    1919import org.sophie2.base.scene.helpers.SceneHelper; 
    2020import org.sophie2.base.scene.interfaces.Scene; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.base.skins.SkinElementId; 
    2223import org.sophie2.base.visual.skins.VisualElementDef; 
    2324import org.sophie2.main.app.commons.frame.FrameView; 
     
    4041@VisualElementDef(parent = FrameRotateHaloMenu.class, sortKey = "jjj-frame-rotate-left-halo-button") 
    4142public class FrameRotateHaloButton extends MoveHaloButton { 
    4243 
     44        /** 
     45         * Constant created for own frame rotation. 
     46         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     47         * Used for skinning. 
     48         */ 
     49        public static final String FRAME_ROTATING_OWN = "Frame rotating (own)..."; 
     50         
     51        /** 
     52         * Constant created for expressing that frame is deleted using scripting. 
     53         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     54         * Used for skinning. 
     55         */ 
     56        public static final String FRAME_ROTATING_UNTEMPLATE = "Frame rotating (untemplate)..."; 
     57 
    4358        @Override 
    4459        protected MouseCapture captureClick(MouseEvent e) { 
    4560                // all will be in parent element's space 
     
    98113                        private void templatedRotation(final double newAngle,  
    99114                                        final TimePos time, final ImmPoint newLocation, boolean significant) { 
    100115                                final LocationChannel oldChannel = frame.get(MemberElement.KEY_LOCATION); 
    101                                 new AutoAction("Frame rotating (untemplate)...", significant) { 
     116                                new AutoAction(Message.create(FRAME_ROTATING_UNTEMPLATE), significant) { 
    102117 
    103118                                        @Override 
    104119                                        public void performAuto() { 
     
    113128                         
    114129                        private void customRotation(final double newAngle,  
    115130                                        final TimePos time, final ImmPoint newLocation, boolean significant) { 
    116                                 new AutoAction("Frame rotating (own)...", significant) { 
     131                                new AutoAction(Message.create(FRAME_ROTATING_OWN), significant) { 
    117132 
    118133                                        @Override 
    119134                                        public void performAuto() { 
  • modules/org.sophie2.base.model.resources.r4/pom.xml

     
    3636                        <version>2.0.5</version> 
    3737                </dependency> 
    3838                <dependency> 
     39                        <groupId>org.sophie2</groupId> 
     40                        <artifactId>org.sophie2.base.skins</artifactId> 
     41                        <version>2.0.5</version> 
     42                </dependency> 
     43                <dependency> 
    3944                        <groupId>junit</groupId> 
    4045                        <artifactId>junit</artifactId> 
    4146                        <version>4.4</version> 
  • modules/org.sophie2.main.func.resources/src/test/java/org/sophie2/main/func/resources/imports/ResourceImportUtilTest.java

     
    2929import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3030import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    3131import org.sophie2.base.skins.BaseSkinsModule; 
     32import org.sophie2.base.skins.Message; 
    3233import org.sophie2.base.visual.BaseVisualModule; 
    3334import org.sophie2.core.logging.LogLevel; 
    3435import org.sophie2.core.logging.SophieLog; 
     
    5556 */ 
    5657public class ResourceImportUtilTest extends AppTestBase { 
    5758 
     59        /** 
     60         * Constant created for creating cold text. 
     61         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     62         * Used for skinning. 
     63         */ 
     64        public static final String CREATING_COLD_TEXT = "Creating cold text"; 
     65 
    5866        private final static class ColdTransferable implements DndTransferable { 
    5967         
    6068                final String text; 
     
    267275                        ResourceRefR4.generateRandomSub(ColdTextResource.DEFAULT_TITLE); 
    268276                final String text = "My text"; 
    269277                 
    270                 new AutoAction("Creating cold text", true) { 
     278                new AutoAction(Message.create(CREATING_COLD_TEXT), true) { 
    271279                        @Override 
    272280                        public void performAuto() { 
    273281                                ColdTextResourceHelper.createColdText(getChanger(), 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/resource/r4/PersistenceTest.java

     
    3737import org.sophie2.base.persistence.persister.MasterPersister; 
    3838import org.sophie2.base.persistence.ref.ValueRef; 
    3939import org.sophie2.base.persistence.storage.Storage; 
     40import org.sophie2.base.skins.Message; 
    4041import org.sophie2.core.logging.LogLevel; 
    4142import org.sophie2.core.logging.SophieLog; 
    4243import org.sophie2.core.modularity.FakeModuleRegistry; 
     
    5051 */ 
    5152public class PersistenceTest extends IntegrationTestBase { 
    5253         
     54        /** 
     55         * Constant created for creating frame 1. 
     56         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     57         * Used for skinning. Used in the test. 
     58         */ 
     59        public static final String CREATE_FRAME1 = "Create Frame1"; 
     60         
     61        /** 
     62         * Constant created for creating a book with two pages. 
     63         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     64         * Used for skinning. Used in the test. 
     65         */ 
     66        public static final String CREATE_A_BOOK_WITH_TWO_PAGES = "Create a book with two pages"; 
    5367        private DelegatingFileAccess access; 
    5468        private ResourceRefR4 ref; 
    5569        private static AppLocator locator = new AppLocator(); 
     
    169183                ResourceRevision head = LocalResourceRevision.getInitialRevision(); 
    170184                ResourceAccess access = locator.create(ref, AccessOptions.DEFAULT_ACCESS_OPTIONS, head); 
    171185 
    172                 new AutoAction("Create a book with two pages", true) { 
     186                new AutoAction(Message.create(CREATE_A_BOOK_WITH_TWO_PAGES), true) { 
    173187                        @Override 
    174188                        public void performAuto() { 
    175189                                getChanger().setRaw(ResourceR4.KEY_KIND, BookR4.KIND); 
     
    200214                        } 
    201215                }.register(access); 
    202216                 
    203                 new AutoAction("Create Frame1", true) { 
     217                new AutoAction(Message.create(CREATE_FRAME1), true) { 
    204218                        @Override 
    205219                        public void performAuto() { 
    206220                                ResourceRefR4 subRef = ResourceRefR4.make("./PAGE_A/FRAME_1"); 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/changes/ModelChange.java

     
    99import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1010import org.sophie2.base.model.resources.r4.keys.Key; 
    1111import org.sophie2.base.model.resources.r4.model.ResourceReader; 
     12import org.sophie2.base.skins.Message; 
    1213import org.sophie2.core.prolib.annot.Immutable; 
    1314 
    1415/** 
     
    5152         * @param actionFieldValues 
    5253         *            The parameters to construct the {@link AutoAction} with. 
    5354         */ 
    54         public ModelChange(ResourceRefR4 changeScope, ResourceRefR4 user, String viewId, String description, 
     55        public ModelChange(ResourceRefR4 changeScope, ResourceRefR4 user, String viewId, Message description, 
    5556                        boolean significant, Class<? extends AutoAction> actionClass, 
    5657                        ImmList<?> actionFieldValues) { 
    5758                super(user, viewId, description, significant); 
     
    167168                        } 
    168169                } catch (Exception e) { 
    169170                        throw new RuntimeException("The change AutoAction of '" + this.toString()  
    170                                                                                         + "' colud not be resurrected.", e); 
     171                                                                                        + "' could not be resurrected.", e); 
    171172                } 
    172173                return res; 
    173174        } 
  • modules/org.sophie2.main.app.commons/src/test/java/org/sophie2/main/app/commons/frame/FrameResizeTest.java

     
    2323import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2424import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2525import org.sophie2.base.skins.BaseSkinsModule; 
     26import org.sophie2.base.skins.Message; 
    2627import org.sophie2.base.visual.BaseVisualModule; 
    2728import org.sophie2.base.visual.interaction.InputEventR3; 
    2829import org.sophie2.base.visual.interaction.ModifierSet; 
     
    5051 */ 
    5152public class FrameResizeTest extends AppTestBase { 
    5253         
     54        /** 
     55         * Constant created for setting rotation angle. 
     56         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     57         * Used for skinning. 
     58         */ 
     59        public static final String SET_ROTATION_ANGLE = "Set rotation angle"; 
    5360        private FrameView fv; 
    5461        private FrameH frame; 
    5562         
     
    169176        @Test 
    170177        public void testRotatedTopArea() { 
    171178                 
    172                 new AutoAction("Set rotation angle", true) { 
     179                new AutoAction(Message.create(SET_ROTATION_ANGLE), true) { 
    173180                         
    174181                        @Override 
    175182                        public void performAuto() { 
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/StyledElementH.java

     
    1313import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1414import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1515import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
     16import org.sophie2.base.skins.Message; 
    1617 
    1718/** 
    1819 * A helper class for getting the properties of an {@link StyledElement} 
     
    2122 */ 
    2223public class StyledElementH { 
    2324 
     25        /** 
     26         * Constant created for toggling background lock. 
     27         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     28         * Used for skinning. 
     29         */ 
     30        public static final String BG_LOCK = "Toggle background lock"; 
     31         
     32        /** 
     33         * Constant created for toggling background templating. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. 
     36         */ 
     37        public static final String BG_TEMPLATING = "Toggle background templating"; 
     38         
     39        /** 
     40         * Constant created for toggling border lock. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. 
     43         */ 
     44        public static final String BORDER_LOCK = "Toggle border lock"; 
     45         
     46        /** 
     47         * Constant created for toggling border templating lock. 
     48         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     49         * Used for skinning. 
     50         */ 
     51        public static final String BORDER_TEMPLATING = "Toggle border templating"; 
    2452        private final ResourceAccess access; 
    2553 
    2654        /** 
     
    167195                        newColor = StyledElement.KEY_BORDER__COLOR.get(this.access); 
    168196                } 
    169197 
    170                 new AutoAction("Toggle border templating", true) { 
     198                new AutoAction(Message.create(BORDER_TEMPLATING), true) { 
    171199                        @Override 
    172200                        public void performAuto() { 
    173201                                ResourceChanger ch = getChanger(); 
     
    189217                final ImmColor borderColor = getBorderColor(); 
    190218                final ImmInsets borderInsets = getBorderInsets(); 
    191219 
    192                 new AutoAction("Toggle border lock", true) { 
     220                new AutoAction(Message.create(BORDER_LOCK), true) { 
    193221                        @Override 
    194222                        public void performAuto() { 
    195223                                ResourceChanger ch = getChanger(); 
     
    228256                        opacity =  getBackgroundOpacity(); 
    229257                } 
    230258 
    231                 new AutoAction("Toggle background templating", true) { 
     259                new AutoAction(Message.create(BG_TEMPLATING), true) { 
    232260                        @Override 
    233261                        public void performAuto() { 
    234262                                ResourceChanger ch = getChanger(); 
     
    255283                final ImmGradient gradient = getBackgroundGradient(); 
    256284                final Float opacity = getBackgroundOpacity(); 
    257285 
    258                 new AutoAction("Toggle background lock", true) { 
     286                new AutoAction(Message.create(BG_LOCK), true) { 
    259287                        @Override 
    260288                        public void performAuto() { 
    261289                                ResourceChanger ch = getChanger(); 
  • modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/logic/ResourceDeleteLogic.java

     
    1111import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1212import org.sophie2.base.model.resources.r4.keys.Key; 
    1313import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     14import org.sophie2.base.skins.Message; 
    1415import org.sophie2.core.mvc.EventFilterBuilder; 
    1516import org.sophie2.core.mvc.LogicR3; 
    1617import org.sophie2.core.mvc.OperationDef; 
     
    8384                } 
    8485        }; 
    8586         
     87        /** 
     88         * Constant created for removing template. 
     89         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     90         * Used for skinning. 
     91         */ 
     92        public static final String REMOVE_TEMPLATE = "Remove template."; 
    8693        //TODO Think of a better place for those: 
    8794         
    8895        /** 
     96         * Constant created for removing resource. 
     97         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     98         * Used for skinning. 
     99         */ 
     100        public static final String REMOVE_RESOURCE = "Remove resource"; 
     101 
     102        /** 
    89103         * Deletes a resource.  
    90104         *  
    91105         * @param resource 
     
    107121 
    108122                final ResourceRefR4 resourceRef = ResourceRefR4.getRelativeRef( 
    109123                                bookAccess.getRef(), resource.getRef()); 
    110                 new AutoAction("Remove resource", true) { 
     124                new AutoAction(Message.create(REMOVE_RESOURCE), true) { 
    111125                        @Override 
    112126                        public void performAuto() { 
    113127                                getChanger().removeResource(resourceRef); 
     
    191205                ResourceAccess bookAccess = bookView.getAccess(); 
    192206                final ResourceRefList templates = key.get(bookAccess); 
    193207                if (templates.contains(ref)) { 
    194                         new AutoAction("Remove template.", true) { 
     208                        new AutoAction(Message.create(REMOVE_TEMPLATE), true) { 
    195209                                @Override 
    196210                                public void performAuto() { 
    197211                                        getChanger().removeResource(ref); 
  • modules/org.sophie2.main.func.text/src/test/java/org/sophie2/main/func/text/content/view/HotTextSearchTest.java

     
    1212import org.sophie2.base.model.book.PageH; 
    1313import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1414import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
     15import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1516import org.sophie2.base.model.text.smart.ImmHotText; 
    1617import org.sophie2.base.natlib.BaseNatlibModule; 
    1718import org.sophie2.base.scene.BaseSceneModule; 
    1819import org.sophie2.base.skins.BaseSkinsModule; 
     20import org.sophie2.base.skins.Message; 
    1921import org.sophie2.base.visual.BaseVisualModule; 
    2022import org.sophie2.core.modularity.SophieModule; 
    2123import org.sophie2.core.mvc.CoreMvcModule; 
     
    4042 */ 
    4143public class HotTextSearchTest extends AppTestBase { 
    4244 
     45        /** 
     46         * Constant created for creating frame 2. 
     47         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     48         * Used for skinning. Used in the test. 
     49         */ 
     50        public static final String CREATE_FRAME_2 = "Create frame 2"; 
     51         
     52        /** 
     53         * Constant created for creating frame. 
     54         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     55         * Used for skinning. Used in the test. 
     56         */ 
     57        public static final String CREATE_FRAME = "Create frame"; 
    4358        private BookH book; 
    4459        private RootPageView pageView; 
    4560        private HeadTextFrameView frameView; 
     
    7994                this.hotText = ImmHotText.createPlain("a b c ddd e fff g h i j k lll"); 
    8095                 
    8196                HeadTextFrameH.createTextFrameAction(this.book, page, this.hotText, ResourceRefR4.NONE_REF.toUri(), null, 
    82                                 "Create frame", true); 
     97                                Message.create(CREATE_FRAME), true); 
    8398                this.pageView = bdw.bookView().get().getPageView( 
    8499                                ResourceRefR4.getRelativeRef(this.book.getRef(), page.getRef())); 
    85100 
     
    94109        @Test 
    95110        public void testElementSearch() { 
    96111                HeadTextFrameH.createTextFrameAction(this.book, this.pageView.model().get(), ImmHotText.createPlain("ddd"), ResourceRefR4.NONE_REF.toUri(), 
    97                                 null, "Create frame 2", true); 
     112                                null, Message.create(CREATE_FRAME_2), true); 
    98113 
    99114                List<SearchMatch> results = new ArrayList<SearchMatch>(); 
    100115                this.pageView.search("ddd", results); 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/appearance/ImagePickerHud.java

     
    2828import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2929import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    3030import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     31import org.sophie2.base.skins.Message; 
    3132import org.sophie2.base.skins.SkinElementId; 
    3233import org.sophie2.base.visual.BaseVisualElement; 
    3334import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    199200                                        } else { 
    200201                                                selectedRef = ResourceRefR4.NONE_REF; 
    201202                                        } 
    202                                         new AutoAction("Change background image", true) { 
     203                                        new AutoAction(Message.create(CHANGE_BACKGROUND_IMAGE), true) { 
    203204                                                @Override 
    204205                                                public void performAuto() { 
    205206                                                        getChanger().setRaw(StyledElement.KEY_BACKGROUND__IMAGE, selectedRef); 
     
    212213 
    213214                        }; 
    214215 
     216                        /** 
     217                         * Constant created for changing background image. 
     218                         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     219                         * Used for skinning. 
     220                         */ 
     221                        public static final String CHANGE_BACKGROUND_IMAGE = "Change background image"; 
    215222                } 
    216223 
    217224        } 
     
    283290                                         
    284291                                        final PatternOptions newOptions = oldOptions.modifyOffset(newOffset); 
    285292                                         
    286                                         new AutoAction("change-background-image-x-offset", true) { 
     293                                        new AutoAction(Message.create(CHANGE_BACKGROUND_IMAGE_X_OFFSET), true) { 
    287294                                                @Override 
    288295                                                public void performAuto() { 
    289296                                                        getChanger().setRaw(StyledElement.KEY_BACKGROUND__TYPE, BackgroundType.IMAGE); 
     
    319326                                         
    320327                                        final PatternOptions newOptions = oldOptions.modifyOffset(newOffset); 
    321328                                         
    322                                         new AutoAction("Change background image offset", true) { 
     329                                        new AutoAction(Message.create(CHANGE_BACKGROUND_IMAGE_OFFSET), true) { 
    323330                                                @Override 
    324331                                                public void performAuto() { 
    325332                                                        getChanger().setRaw(StyledElement.KEY_BACKGROUND__TYPE, BackgroundType.IMAGE); 
     
    352359                                         
    353360                                        final PatternOptions newOptions = oldOptions.modifyScale(newSize); 
    354361                                         
    355                                         new AutoAction("Change background image scale", true) { 
     362                                        new AutoAction(Message.create(CHANGE_BACKGROUND_IMAGE_SCALE), true) { 
    356363                                                @Override 
    357364                                                public void performAuto() { 
    358365                                                        getChanger().setRaw(StyledElement.KEY_BACKGROUND__TYPE, BackgroundType.IMAGE); 
     
    382389                                        PatternOptions oldOptions = AppearanceHud.getStyleHelper(hud).getBackgroundPattern().getOptions(); 
    383390 
    384391                                        final PatternOptions newOptions = oldOptions.modifyType(input.getSelectedItem());  
    385                                         new AutoAction("Change background pattern type", true) { 
     392                                        new AutoAction(Message.create(CHANGE_BACKGROUND_PATTERN_TYPE), true) { 
    386393                                                @Override 
    387394                                                public void performAuto() { 
    388395                                                        getChanger().setRaw(StyledElement.KEY_BACKGROUND__TYPE, BackgroundType.IMAGE); 
     
    394401 
    395402                        }; 
    396403 
     404                        /** 
     405                         * Constant created for changing background pattern type. 
     406                         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     407                         * Used for skinning. 
     408                         */ 
     409                        public static final String CHANGE_BACKGROUND_PATTERN_TYPE = "Change background pattern type"; 
     410                         
     411                        /** 
     412                         * Constant created for changing background image scale. 
     413                         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     414                         * Used for skinning. 
     415                         */ 
     416                        public static final String CHANGE_BACKGROUND_IMAGE_SCALE = "Change background image scale"; 
     417                         
     418                        /** 
     419                         * Constant created for changing background image offset. 
     420                         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     421                         * Used for skinning. 
     422                         */ 
     423                        public static final String CHANGE_BACKGROUND_IMAGE_OFFSET = "Change background image offset"; 
     424                         
     425                        /** 
     426                         * Constant created changing background image x offset. 
     427                         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     428                         * Used for skinning. 
     429                         */ 
     430                        public static final String CHANGE_BACKGROUND_IMAGE_X_OFFSET = "change-background-image-x-offset"; 
     431 
    397432                } 
    398433        } 
    399434 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/changes/AutoAction.java

     
    1212import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1313import org.sophie2.base.model.resources.r4.access.DelegatingAccess; 
    1414import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
     15import org.sophie2.base.skins.Message; 
    1516import org.sophie2.core.prolib.util.ProUtil; 
    1617 
    1718/** 
     
    2425 */ 
    2526public abstract class AutoAction { 
    2627 
    27         private final String description; 
     28        private final Message description; 
    2829        private final boolean significant; 
    2930 
    3031        /** 
     
    3637         * @param significant 
    3738         *                      The significance of the new <code>AutoAction</code>. 
    3839         */ 
    39         public AutoAction(String description, boolean significant) { 
     40        public AutoAction(Message description, boolean significant) { 
    4041                this.description = description; 
    4142                this.significant = significant; 
    4243        } 
     
    8889                                access.getAccessOptions().getViewId(), 
    8990                                this.description, this.significant, autoActionClass, 
    9091                                values)); 
     92                //message 
    9193        } 
    9294         
    9395        /** 
     
    164166         * @param description 
    165167         *                      String description of the change to be registered. 
    166168         */ 
    167         public static void registerEndChange(ResourceAccess access, String description) { 
     169        public static void registerEndChange(ResourceAccess access, Message description) { 
    168170                EndAutoAction endChange = new EndAutoAction(description); 
    169171                endChange.register(access); 
    170172        } 
     
    184186                 * @param description 
    185187                 *                      The description oft he new change. 
    186188                 */ 
    187                 public EndAutoAction(String description) { 
     189                public EndAutoAction(Message description) { 
    188190                        super(description, true); 
    189191                } 
    190192 
  • modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/logic/RunScriptLogic.java

     
    1515import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1616import org.sophie2.base.model.resources.r4.access.ResourceLocator; 
    1717import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     18import org.sophie2.base.skins.Message; 
    1819import org.sophie2.core.modularity.SortKey; 
    1920import org.sophie2.core.mvc.EventFilterBuilder; 
    2021import org.sophie2.core.mvc.OperationDef; 
     
    9495                                        result = "(no result)"; 
    9596                                } 
    9697                                view.scriptResult().set(result != null ? result.toString() : "null"); 
    97                                 String description = "Run script '" + resource.getName() + "'."; 
    98                                 AutoAction.registerEndChange(view.getAccess(), description); 
     98                                AutoAction.registerEndChange(view.getAccess(), Message.create(RUN_SCRIPT, resource.getName())); 
    9999                        } catch (EcmaError e) { 
    100100                                view.scriptResult().set("ERROR: " + e.getMessage()); 
    101101                        } catch (EvaluatorException e) { 
     
    107107                        return true; 
    108108                } 
    109109        }, 
    110  
     110         
    111111        /** 
    112112         * The 'Run script' action triggered by link. 
    113113         */ 
     
    201201                jsAdapter.setAdaptedObject(adaptedObject); 
    202202 
    203203        } 
     204         
     205        /** 
     206         * Constant created for running a script. Takes one parameter - resource name. 
     207         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     208         * Used for skinning. 
     209         */ 
     210        public static final String RUN_SCRIPT = "Run script %1$s."; 
    204211} 
  • modules/org.sophie2.server.core/src/test/java/org/sophie2/server/core/facade/ServerFacadeTest.java

     
    4141import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    4242import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    4343import org.sophie2.base.model.security.BaseModelSecurityModule; 
     44import org.sophie2.base.skins.Message; 
    4445import org.sophie2.core.logging.SophieLog; 
    4546import org.sophie2.core.modularity.FakeModuleRegistry; 
    4647import org.sophie2.core.testing.UnitTestBase; 
     
    5657 */ 
    5758public class ServerFacadeTest extends UnitTestBase { 
    5859 
     60        /** 
     61         * Constant created for creating a resource. 
     62         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     63         * Used for skinning. Used in the test. 
     64         */ 
     65        public static final String CREATE_RESOURCE = "Create resource"; 
     66         
     67        /** 
     68         * Constant created for creating a new page. 
     69         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     70         * Used for skinning. Used in the test. 
     71         */ 
     72        public static final String CREATE_NEW_PAGE = "Create new page"; 
    5973        private ServerFacade facade; 
    6074 
    6175        private ResourceAccess createBook(ResourceRefR4 bookRef) throws Exception { 
     
    8296                final String pageName =  
    8397                        ResourceUtil.getNextTitle(book.getRef(), PageR4.DEFAULT_TITLE); 
    8498                 
    85                 new AutoAction("Create new page", true) { 
     99                new AutoAction(Message.create(CREATE_NEW_PAGE), true) { 
    86100                        @Override 
    87101                        public void performAuto() { 
    88102                                BookH.addNewPage(getChanger(), pageRef, pages, pageName); 
     
    95109        private ResourceAccess initResource(ResourceAccess access, 
    96110                        Class<? extends ResourceR4> resourceModelClass) throws Exception { 
    97111                final ImmList<Key<?>> modelKeys = findModelKeys(resourceModelClass); 
    98                 new AutoAction("Create resource", true) { 
     112                new AutoAction(Message.create(CREATE_RESOURCE), true) { 
    99113                        @SuppressWarnings("unchecked") 
    100114                        @Override 
    101115                        public void performAuto() { 
     
    195209                ResourceAccess access = createBook(memRef); 
    196210                final int changesCount = 10; 
    197211                for (int i = 0; i < changesCount; i++) { 
    198                         createDummyChange(access, "dummy change " + i); 
     212                        createDummyChange(access, Message.create("dummy change " + i)); 
    199213                } 
    200214                Response<ImmList<HistoryEntry>> resourceHistory; 
    201215                resourceHistory = this.facade.getResourceHistory("123", serverRef, 
     
    233247                                changesCount)); 
    234248        } 
    235249 
    236         private void createDummyChange(ResourceAccess access, String comment) { 
     250        private void createDummyChange(ResourceAccess access, Message comment) { 
    237251 
    238252                new AutoAction(comment, true) { 
    239253 
  • modules/org.sophie2.server.mock/src/main/java/org/sophie2/server/mock/bindata/FacadeBinDataTest.java

     
    3232import org.sophie2.base.model.resources.r4.keys.UndefinedKey; 
    3333import org.sophie2.base.model.resources.r4.model.ResourceModel; 
    3434import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     35import org.sophie2.base.skins.Message; 
    3536import org.sophie2.core.logging.LogLevel; 
    3637import org.sophie2.core.logging.SophieLog; 
    3738import org.sophie2.core.modularity.FileEntryManager; 
     
    4950 */ 
    5051public class FacadeBinDataTest extends ServerModelTestBase { 
    5152 
     53        /** 
     54         * Constant created for uploading. 
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. Used in the test. 
     57         */ 
     58        public static final String UPLOAD = "Upload"; 
     59         
     60        /** 
     61         * Constant created for setting up binary server book. 
     62         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     63         * Used for skinning. Used in the test. 
     64         */ 
     65        public static final String SETUP_BINATY_SERVER_BOOK = "Setup binaty server book"; 
    5266        private FileBinData testData = null; 
    5367         
    5468        @Override 
     
    94108                final BinData testData2 = new RawBinData("boo booo".getBytes()); 
    95109                final ResourceRefR4 ref = ResourceRefR4.generateRandomSub("bin"); 
    96110                 
    97                 new AutoAction("Setup binaty server book", true) { 
     111                new AutoAction(Message.create(SETUP_BINATY_SERVER_BOOK), true) { 
    98112                        @Override 
    99113                        public void performAuto() { 
    100114                                getChanger().makeResource(ref); 
     
    190204                                getFacade(), absServerRef, sessionId, originalModel, false); 
    191205                final ResourceRefList curResources = getServerDirectory().getResources(); 
    192206                 
    193                 new AutoAction("Upload", true) { 
     207                new AutoAction(Message.create(UPLOAD), true) { 
    194208                         
    195209                        @Override 
    196210                        public void performAuto() { 
  • modules/org.sophie2.main.func.text/src/test/java/org/sophie2/main/func/text/links/LinkAttachmentsTest.java

     
    3030import org.sophie2.base.model.text.smart.layout.HotLayout; 
    3131import org.sophie2.base.model.text.smart.position.HotInterval; 
    3232import org.sophie2.base.skins.BaseSkinsModule; 
     33import org.sophie2.base.skins.Message; 
    3334import org.sophie2.base.visual.BaseVisualModule; 
    3435import org.sophie2.base.visual.interaction.InputEventR3; 
    3536import org.sophie2.base.visual.interaction.ModifierSet; 
     
    6061 */ 
    6162public class LinkAttachmentsTest extends AppTestBase { 
    6263 
     64        /** 
     65         * Constant created for creating a frame. 
     66         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     67         * Used for skinning. Used in the test. 
     68         */ 
     69        public static final String CREATE_FRAME = "Create frame"; 
     70         
     71        /** 
     72         * Constant created for adding link. 
     73         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     74         * Used for skinning. Used in the test. 
     75         */ 
     76        public static final String ADD_LINK = "Add link"; 
    6377        private HeadTextFrameView fv; 
    6478        private HeadTextFrameH textFrame; 
    6579 
     
    90104               ImmHotText text = ImmHotText.createPlain(str); 
    91105               ResourceRefR4 textFrameRef = 
    92106                   HeadTextFrameH.createTextFrameAction(book, new PageH(pageAccess), 
    93                                text, ResourceRefR4.NONE_REF.toUri(), null, "Create frame", true); 
     107                               text, ResourceRefR4.NONE_REF.toUri(), null, Message.create(CREATE_FRAME), true); 
    94108               ResourceAccess textFrameAccess = bookAccess.open(textFrameRef, null); 
    95109               this.textFrame = new HeadTextFrameH(textFrameAccess); 
    96110 
     
    107121                               ImmColor.MAGENTA); 
    108122               final ImmHotText newText = text.addAttachment(this.linkInterval, this.linkAtt); 
    109123 
    110                new AutoAction("Add link", true) { 
     124               new AutoAction(Message.create(ADD_LINK), true) { 
    111125 
    112126                       @Override 
    113127                       public void performAuto() { 
  • modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/frame/ApplyFrameTemplateHandler.java

     
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    99import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    1010import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     11import org.sophie2.base.skins.Message; 
    1112import org.sophie2.main.app.commons.element.ElementDropHandler; 
    1213import org.sophie2.main.app.commons.frame.FrameView; 
    1314import org.sophie2.main.app.commons.util.TemplateUtil; 
     
    5960                final String templateKind = templateH.getKind(); 
    6061                final NaiveImmList<TemplatedKey<?>> immKeys = templateH.getApplicableTemplatedKeys(); 
    6162 
    62                 new AutoAction("Apply frame template.", true) { 
     63                new AutoAction(Message.create(FRAME_TEMPLATE), true) { 
    6364 
    6465                        @Override 
    6566                        public void performAuto() { 
     
    6970 
    7071                }.register(frameAccess); 
    7172        } 
     73         
     74        /** 
     75         * Constant created for applying frame template. 
     76         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     77         * Used for skinning. 
     78         */ 
     79        public static final String FRAME_TEMPLATE = "Apply frame template.";  
    7280} 
  • modules/org.sophie2.main.app.commons/src/main/java/org/sophie2/main/app/commons/book/BookView.java

     
    2424import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2525import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2626import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     27import org.sophie2.base.skins.Message; 
    2728import org.sophie2.base.visual.BaseVisualElement; 
    2829import org.sophie2.core.logging.Profiler; 
    2930import org.sophie2.core.logging.SophieLog; 
     
    5051public class BookView extends BaseVisualElement implements MediaComposite, ResourceView { 
    5152 
    5253        /** 
     54         * Constant created for adding new templated page. 
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. 
     57         */ 
     58        public static final String ADD_NEW_TEMPLATED_PAGE = "Add a new templated page"; 
     59         
     60        /** 
     61         * Constant created for adding new page. 
     62         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     63         * Used for skinning. 
     64         */ 
     65        public static final String ADD_NEW_PAGE = "Add a new page"; 
     66 
     67        /** 
    5368         * Creates a new {@code BookView} with a given {@link ResourceAccess}. Sets 
    5469         * the {@link BookViewOptions} to the default author options. 
    5570         *  
     
    501516                ResourceRefR4 realTemplateRef = getTemplateRef(templateRef); 
    502517                boolean significant = ResourceRefR4.NONE_REF.equals(realTemplateRef); 
    503518 
    504                 new AutoAction("Add a new page", significant) { 
     519                new AutoAction(Message.create(ADD_NEW_PAGE), significant) { 
    505520 
    506521                        @Override 
    507522                        public void performAuto() { 
     
    523538 
    524539                        TemplateUtil.applyPageTemplate(page, absTemplateRef, null, getAllSubelements(templateH)); 
    525540                         
    526                         AutoAction.registerEndChange(getAccess(), "Add a new templated page"); 
     541                        AutoAction.registerEndChange(getAccess(), Message.create(ADD_NEW_TEMPLATED_PAGE)); 
    527542                } 
    528543                                 
    529544                goToPage(model().get().getPages().get(index)); 
  • modules/org.sophie2.base.skins/src/main/java/org/sophie2/base/skins/Message.java

     
     1package org.sophie2.base.skins; 
     2 
     3import java.util.ArrayList; 
     4import java.util.List; 
     5 
     6import org.sophie2.core.logging.SophieLog; 
     7import org.sophie2.core.prolib.annot.Immutable; 
     8 
     9/** 
     10 * Message is the object that will be transferred when an auto action is created. 
     11 * A message object is constructed via a factory create method. Constructed via key and parameters. 
     12 * The key parameter is the one that will be used for skinning. The number of parameters can be different 
     13 * every time. The parameters are the parameters of the key. 
     14 *  
     15 *  
     16 * <ul> 
     17 * <b>Example</b> 
     18 * <li> key = "The size changed from %1$s to %2$s" 
     19 * <li> param1 = 10 
     20 * <li> param2 = 20 
     21 * </ul> 
     22 *  
     23 *  
     24 * Messages are important when there are different clients with different localization. 
     25 *  
     26 * @author tanya 
     27 */ 
     28@Immutable 
     29public class Message { 
     30 
     31        private List<Object> parameters; 
     32        private String key; 
     33         
     34        private Message(String key, Object...parameters) { 
     35                this.key = key; 
     36                this.parameters = new ArrayList<Object>(); 
     37                 
     38                for (Object param : parameters) { 
     39                        this.parameters.add(param); 
     40                } 
     41        } 
     42         
     43        /** 
     44         * Factory method that creates a new message. 
     45         *  
     46         * @param key  
     47         *                      The key using which the description of the auto action is to be skinned. 
     48         * @param parameters 
     49         *                              The parameters of the key that will be necessary to the description to be created.   
     50         * @return  
     51         *              New instance of a message. 
     52         */ 
     53        public static Message create(String key, Object...parameters) { 
     54                assert key != null : "Key must not be null!"; 
     55                assert key != "" : "Key must not be empty string!"; 
     56                 
     57                return new Message(key, parameters); 
     58        } 
     59         
     60        /** 
     61         * Returns the description of the message. 
     62         *  
     63         * @return 
     64         *              The description of the message. 
     65         */ 
     66        public String getText() { 
     67                String fromSkin = SkinUtil.getSkinValue(getClass(), this.key, String.class); 
     68                String toFormat = (fromSkin == null)? this.key : fromSkin; 
     69 
     70                SophieLog.trace(toFormat); 
     71                SophieLog.trace(this.parameters); 
     72                 
     73                return String.format(toFormat, this.parameters.toArray()); 
     74        } 
     75         
     76        @Override 
     77        public int hashCode() { 
     78                final int prime = 31; 
     79                int result = 1; 
     80                result = prime * result + ((this.key == null) ? 0 : this.key.hashCode()); 
     81                result = prime * result 
     82                                + ((this.parameters == null) ? 0 : this.parameters.hashCode()); 
     83                return result; 
     84        } 
     85 
     86        @Override 
     87        public boolean equals(Object obj) { 
     88                if (this == obj) { 
     89                        return true; 
     90                } 
     91                if (obj == null) { 
     92                        return false; 
     93                } 
     94                if (getClass() != obj.getClass()) { 
     95                        return false; 
     96                } 
     97                Message other = (Message) obj; 
     98                if (this.key == null) { 
     99                        if (other.key != null) { 
     100                                return false; 
     101                        } 
     102                } else if (!this.key.equals(other.key)) { 
     103                        return false; 
     104                } 
     105                if (this.parameters == null) { 
     106                        if (other.parameters != null) { 
     107                                return false; 
     108                        } 
     109                } else if (!this.parameters.equals(other.parameters)) { 
     110                        return false; 
     111                } 
     112                return true; 
     113        } 
     114} 
  • modules/org.sophie2.server.core/src/test/java/org/sophie2/server/core/facade/MergeChangesTest.java

     
    2626import org.sophie2.base.model.resources.r4.model.ResourceModel; 
    2727import org.sophie2.base.model.resources.r4.model.RevisionId; 
    2828import org.sophie2.base.persistence.BasePersistenceModule; 
     29import org.sophie2.base.skins.Message; 
    2930import org.sophie2.core.modularity.FakeModuleRegistry; 
    3031import org.sophie2.server.core.ServerResourceHelper; 
    3132import org.sophie2.server.core.persistence.access.DBResourceAccess; 
     
    4041 */ 
    4142public class MergeChangesTest extends DBModelTest { 
    4243 
     44        /** 
     45         * Constant created for making a book. 
     46         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     47         * Used for skinning. Used in the test. 
     48         */ 
     49        public static final String MAKE_BOOK = "Make book"; 
     50 
    4351        private static final String SERVER_URL = "http://localhost:8003"; 
    4452 
    4553        private ServerFacade facade = null; 
     
    7785        private BookH createInitialBook() { 
    7886                final ResourceRefR4 bookRef = ResourceRefR4.generateRandomSub("Book"); 
    7987 
    80                 new AutoAction("Make book", true) { 
     88                new AutoAction(Message.create(MAKE_BOOK), true) { 
    8189 
    8290                        @Override 
    8391                        public void performAuto() { 
     
    134142 
    135143        private ModelChange createChange(ResourceRefR4 pageRef) { 
    136144                String description = "Change page border"; 
    137                 AutoAction autoAction = new AutoAction(description, true) { 
     145                AutoAction autoAction = new AutoAction(Message.create(description), true) { 
    138146                        @Override 
    139147                        public void performAuto() { 
    140148                                getChanger().setRaw(StyledElement.KEY_BORDER__COLOR, ImmColor.BLUE);  
     
    142150                }; 
    143151                ImmList<Object> fields = AutoAction.getConstructorArgs(autoAction); 
    144152                ModelChange res = new ModelChange(pageRef, null, null,  
    145                                 description, true, autoAction.getClass(), fields); 
     153                                Message.create(description), true, autoAction.getClass(), fields); 
    146154                return res; 
    147155        } 
    148156 
    149157        private ModelChange createDeleteChange(final ResourceRefR4 pageRef) { 
    150158                String description = "Delete page"; 
    151                 AutoAction autoAction = new AutoAction(description, true) { 
     159                AutoAction autoAction = new AutoAction(Message.create(description), true) { 
    152160                        @Override 
    153161                        public void performAuto() { 
    154162                                getChanger().removeResource(pageRef); 
     
    156164                }; 
    157165                ImmList<Object> fields = AutoAction.getConstructorArgs(autoAction); 
    158166                ModelChange res = new ModelChange(ResourceRefR4.CURRENT_REF, null, null,  
    159                                 description, true, autoAction.getClass(), fields); 
     167                                Message.create(description), true, autoAction.getClass(), fields); 
    160168                return res; 
    161169        } 
    162170 
  • modules/org.sophie2.main.func.links/src/main/java/org/sophie2/main/func/links/LinksHudLogic.java

     
    1313import org.sophie2.base.model.book.resource.r4.ElementR4; 
    1414import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1515import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.core.mvc.EventFilterBuilder; 
    1718import org.sophie2.core.mvc.EventParams; 
    1819import org.sophie2.core.mvc.LogicR3; 
     
    8788                                        final Link newLink = new Link(rules.add(newRule)); 
    8889                                         
    8990                                        LogicR3.fire(hud, control, null, event, EventIds.SET_LINK,  
    90                                                         newLink, "Add link rule"); 
     91                                                        newLink, Message.create(ADD_LINK_RULE)); 
    9192                                         
    9293                                        assert holder.getLink().getRules().asList().indexOf(newRule) >= 0 : 
    9394                                                "The rule could not be added!";  
     
    114115                                final Link newLink = new Link(newRules); 
    115116                         
    116117                                LogicR3.fire(hud, control, null, event, EventIds.SET_LINK,  
    117                                                 newLink, "Change link trigger"); 
     118                                                newLink, Message.create(CHANGE_LINK_TRIGGER)); 
    118119 
    119120                                hud.wantedRule().set(newRule); 
    120121                        } 
     
    161162                                final Link newLink = new Link(newRules); 
    162163 
    163164                                LogicR3.fire(hud, control, null, event, EventIds.SET_LINK,  
    164                                                 newLink, "Change link action"); 
     165                                                newLink, Message.create(CHANGE_LINK_ACTION)); 
    165166                                 
    166167                                hud.wantedRule().set(newRule); 
    167168                                SwingUtilities.invokeLater(new Runnable() { 
     
    207208                        final Link newLink = new Link(rules.remove(ruleIndex)); 
    208209 
    209210                        LogicR3.fire(hud, control, null, event, EventIds.SET_LINK,  
    210                                         newLink, "Remove link rule"); 
     211                                        newLink, Message.create(REMOVE_LINK_RULE)); 
    211212                         
    212213                        hud.wantedRule().set(null); 
    213214                        return true; 
     
    230231                        ResourceAccess access = hud.holder().get().getAccess(); 
    231232                         
    232233                        final Link newLink = event.getEventParam(LinksHudLogic.EventIds.LINK_PARAM_INDEX, Link.class); 
    233                         String description = event.getEventParam(LinksHudLogic.EventIds.DESCRIPTION_PARAM_INDEX, String.class); 
     234                        Message description = event.getEventParam(LinksHudLogic.EventIds.DESCRIPTION_PARAM_INDEX, Message.class); 
    234235                         
    235236                        new AutoAction(description, true) { 
    236237 
     
    246247        }; 
    247248         
    248249        /** 
     250         * Constant created for removing link rule. 
     251         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     252         * Used for skinning. 
     253         */ 
     254        public static final String REMOVE_LINK_RULE = "Remove link rule"; 
     255         
     256        /** 
     257         * Constant created for changing link action. 
     258         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     259         * Used for skinning. 
     260         */ 
     261        public static final String CHANGE_LINK_ACTION = "Change link action"; 
     262         
     263        /** 
     264         * Constant created for changing link tigger. 
     265         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     266         * Used for skinning. 
     267         */ 
     268        public static final String CHANGE_LINK_TRIGGER = "Change link trigger"; 
     269         
     270        /** 
     271         * Constant created for adding link rule. 
     272         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     273         * Used for skinning. 
     274         */ 
     275        public static final String ADD_LINK_RULE = "Add link rule"; 
     276 
     277        /** 
    249278         * The ids of the events that can be fired by this logic. 
    250279         *  
    251280         * @author deni 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/changes/MetaChange.java

     
    1313import org.sophie2.base.model.resources.r4.keys.Key; 
    1414import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    1515import org.sophie2.base.model.resources.r4.model.RevisionId; 
     16import org.sophie2.base.skins.Message; 
    1617 
    1718/** 
    1819 * Represents a meta {@link Change} to the model. 
     
    4142         * @param revisionsToSkip  
    4243         *                      The ids of the revisions this <code>MetaChange</code> reverses.  
    4344         */ 
    44         public MetaChange(ResourceRefR4 user, String viewId, String description, 
     45        public MetaChange(ResourceRefR4 user, String viewId, Message description, 
    4546                        MetaChangeType type, ImmList<RevisionId> revisionsToSkip) { 
    4647                super(user, viewId, description, true); 
    4748                this.type = type; 
     
    100101         *                              The description of the registered skip change. 
    101102         */ 
    102103        public static void registerSkip(ResourceAccess access, ResourceRevision revToSkip, 
    103                         String description) { 
     104                        Message description) { 
    104105                registerMetaChange(access, MetaChangeType.SKIP,  
    105106                                getGroupedRevisions(revToSkip, access.getAccessOptions().getViewId()), 
    106107                                description); 
     
    119120 
    120121                registerMetaChange(access, MetaChangeType.UNDO,  
    121122                                getGroupedRevisions(toUndo, access.getAccessOptions().getViewId()),  
    122                                 toUndo.getLastChange().getDescription()); 
     123                                Message.create(toUndo.getLastChange().getDescription())); 
    123124        } 
    124125 
    125126        private static ImmList<RevisionId> getGroupedRevisions(ResourceRevision revision, 
     
    202203 
    203204                ImmList<RevisionId> skipIds = NaiveImmList.create(toRedo.getId()); 
    204205                registerMetaChange(access, MetaChangeType.REDO, skipIds, 
    205                                 toRedo.getLastChange().getDescription()); 
     206                                Message.create(toRedo.getLastChange().getDescription())); 
    206207 
    207208        } 
    208209 
     
    238239        } 
    239240 
    240241        private static void registerMetaChange(ResourceAccess access, MetaChangeType type,  
    241                         ImmList<RevisionId> revisionsToSkip, String description) { 
     242                        ImmList<RevisionId> revisionsToSkip, Message description) { 
    242243                MetaChange change = new MetaChange(access.getAccessOptions().getUser(), 
    243244                                access.getAccessOptions().getViewId(),  
    244245                                description, type, revisionsToSkip); 
  • modules/org.sophie2.main.func.media/src/main/java/org/sophie2/main/func/media/logic/MediaPropertiesHudLogic.java

     
    66import org.sophie2.base.layout.LogicR3ToggleButton; 
    77import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    88import org.sophie2.base.model.resources.r4.keys.Key; 
     9import org.sophie2.base.skins.Message; 
    910import org.sophie2.core.logging.SophieLog; 
    1011import org.sophie2.core.mvc.EventFilterBuilder; 
    1112import org.sophie2.core.mvc.OperationDef; 
     
    5354                                return false; 
    5455                        } 
    5556 
    56                         new AutoAction("Change looping", true) { 
     57                        new AutoAction(Message.create(CHANGE_LOOPING), true) { 
    5758 
    5859                                @Override 
    5960                                public void performAuto() { 
     
    106107                        final MediaClip clip = new MediaClip(value, helper.getMediaClip() 
    107108                                        .getEndSecond()); 
    108109 
    109                         new AutoAction("Change clipping start position", true) { 
     110                        new AutoAction(Message.create(CHANGE_CLIPPING_START_POSITION), true) { 
    110111 
    111112                                @Override 
    112113                                public void performAuto() { 
     
    156157                        final MediaClip clip = new MediaClip(helper.getMediaClip() 
    157158                                        .getStartSecond(), value); 
    158159 
    159                         new AutoAction("Change clipping end position", true) { 
     160                        new AutoAction(Message.create(CHANGE_CLIPPING_END_POSITION), true) { 
    160161 
    161162                                @Override 
    162163                                public void performAuto() { 
     
    188189                         
    189190                        final Key<Boolean> key = event.getEventParam( 
    190191                                        MediaPropertiesHud.EventIds.KEY_PARAM_INDEX, Key.class); 
    191                         String description = event.getEventParam( 
    192                                         MediaPropertiesHud.EventIds.DESCR_PARAM_INDEX, String.class); 
     192                        Message description = event.getEventParam( 
     193                                        MediaPropertiesHud.EventIds.DESCR_PARAM_INDEX, Message.class); 
    193194                        final boolean shown = event.getEventParam( 
    194195                                        MediaPropertiesHud.EventIds.VISIBLE_PARAM_INDEX, Boolean.class); 
    195196                         
     
    204205                        return true; 
    205206                } 
    206207        }; 
     208 
     209        /** 
     210         * Constant created for changing clipping end position. 
     211         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     212         * Used for skinning. 
     213         */ 
     214        public static final String CHANGE_CLIPPING_END_POSITION = "Change clipping end position"; 
     215         
     216        /** 
     217         * Constant created for changing clipping start position. 
     218         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     219         * Used for skinning. 
     220         */ 
     221        public static final String CHANGE_CLIPPING_START_POSITION = "Change clipping start position"; 
     222         
     223        /** 
     224         * Constant created for changing looping. 
     225         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     226         * Used for skinning. 
     227         */ 
     228        public static final String CHANGE_LOOPING = "Change looping"; 
    207229} 
  • modules/org.sophie2.extra.comment/src/test/java/org/sophie2/extra/comment/model/CommentStreamTest.java

     
    1313import org.sophie2.base.model.resources.r4.immutables.ImmDate; 
    1414import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1515import org.sophie2.base.model.text.smart.ImmHotText; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.core.modularity.SophieModule; 
    1718import org.sophie2.extra.comment.CommentModule; 
    1819import org.sophie2.extra.comment.CommentTestUtil; 
     
    2425 */ 
    2526public class CommentStreamTest extends ModelTestBase { 
    2627         
     28        public static final String ADD_A_REPLY_TO_THE_FIRST_COMMENT = "Add a reply to the first comment."; 
     29        public static final String REMOVE_A_COMMENT_FROM_A_STREAM = "Remove a comment from a stream."; 
    2730        private BookH book; 
    2831         
    2932        @Override 
     
    6568                 
    6669                final ImmTreeList<Comment> comments = stream.get(CommentStream.KEY_COMMENTS); 
    6770                 
    68                 new AutoAction("Remove a comment from a stream.", true) { 
     71                new AutoAction(Message.create(REMOVE_A_COMMENT_FROM_A_STREAM), true) { 
    6972                         
    7073                        @Override 
    7174                        public void performAuto() { 
     
    98101                final Comment reply = new Comment(0, newText, newDate,  
    99102                                newAuthor, CommentTestUtil.COMMENT_1.getCommentId()); 
    100103 
    101                 new AutoAction("Add a reply to the first comment.", true) { 
     104                new AutoAction(Message.create(ADD_A_REPLY_TO_THE_FIRST_COMMENT), true) { 
    102105                         
    103106                        @Override 
    104107                        public void performAuto() { 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/grouping/GroupHalosLogic.java

     
    1818import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1919import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2020import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.core.modularity.SortKey; 
    2223import org.sophie2.core.mvc.EventFilterBuilder; 
    2324import org.sophie2.core.mvc.LogicR3; 
     
    137138                                CompositeElement.KEY_SUB_ELEMENTS.get(access); 
    138139                        final String groupTitle = ResourceUtil.getNextTitle( 
    139140                                        pwa.bookView().get().getAccess().getRef(), ElementGroupR4.DEFAULT_TITLE); 
    140                         new AutoAction("Group elements.", true) { 
     141                        new AutoAction(Message.create(GROUP_ELEMENTS), true) { 
    141142                                @Override 
    142143                                public void performAuto() { 
    143144                                        ElementGroupH.createGroup(getChanger(), groupRef, groupTitle,  
     
    194195                        final ImmList<ActivationChannel> channels =  
    195196                                CompositeElement.KEY_SUB_ELEMENTS.get(parentAccess); 
    196197                         
    197                         new AutoAction("Delete group.", true) { 
     198                        new AutoAction(Message.create(DELETE_GROUP), true) { 
    198199                                @Override 
    199200                                public void performAuto() { 
    200201                                        ElementGroupH.deleteGroup(getChanger(), groupRef, channels); 
     
    243244                        ActivationChannel frameChan = parentH.getActivationChannel(relativeGroupRef); 
    244245                         
    245246                        final ImmList<ActivationChannel> newChannels = channels.remove(frameChan); 
    246                         new AutoAction("Delete Group.", true) { 
     247                        new AutoAction(Message.create(DELETE_GROUP), true) { 
    247248                                @Override 
    248249                                public void performAuto() { 
    249250                                        getChanger().removeResource(relativeGroupRef); 
     
    254255                        return true; 
    255256                } 
    256257                 
    257         } 
     258        }; 
     259 
     260        /** 
     261         * Constant created for deleting a group. 
     262         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     263         * Used for skinning. 
     264         */ 
     265        public static final String DELETE_GROUP = "Delete group."; 
     266         
     267        /** 
     268         * Constant created for grouping elements. 
     269         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     270         * Used for skinning. 
     271         */ 
     272        public static final String GROUP_ELEMENTS = "Group elements."; 
    258273} 
  • modules/org.sophie2.extra.func.scripting/src/test/java/org/sophie2/extra/func/scripting/links/RunScriptLinkActionTest.java

     
    2525import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2626import org.sophie2.base.natlib.BaseNatlibModule; 
    2727import org.sophie2.base.skins.BaseSkinsModule; 
     28import org.sophie2.base.skins.Message; 
    2829import org.sophie2.base.visual.BaseVisualModule; 
    2930import org.sophie2.core.modularity.SophieModule; 
    3031import org.sophie2.core.mvc.CoreMvcModule; 
     
    5556 */ 
    5657public class RunScriptLinkActionTest extends SystemTestBase { 
    5758         
     59        /** 
     60         * Constant created for editing a script. 
     61         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     62         * Used for skinning. Used in the test. 
     63         */ 
     64        public static final String EDIT_SCRIPT = "Edit Script"; 
     65         
     66        /** 
     67         * Constant created for adding a link rule. 
     68         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     69         * Used for skinning. Used in the test. 
     70         */ 
     71        public static final String ADD_LINK_RULE = "Add link rule"; 
     72         
     73        /** 
     74         * Constant created for inserting a script. 
     75         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     76         * Used for skinning. Used in the test. 
     77         */ 
     78        public static final String INSERT_SCRIPT = "Insert script"; 
     79         
     80        /** 
     81         * Constant created for setting a book title. 
     82         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     83         * Used for skinning. Used in the test. 
     84         */ 
     85        public static final String SET_BOOK_TITLE = "Set book title"; 
    5886        private BookH book; 
    5987        private BookDocView bdv; 
    6088         
     
    102130        @Test 
    103131        public void testRunScriptLinkAction() { 
    104132                 
    105                 new AutoAction("Set book title", false) { 
     133                new AutoAction(Message.create(SET_BOOK_TITLE), false) { 
    106134                         
    107135                        @Override 
    108136                        public void performAuto() { 
     
    122150        @Test 
    123151        public void testInvalidScript() { 
    124152                 
    125                 new AutoAction("Set book title", false) { 
     153                new AutoAction(Message.create(SET_BOOK_TITLE), false) { 
    126154                         
    127155                        @Override 
    128156                        public void performAuto() { 
     
    143171                final ResourceRefR4 scriptRef =  
    144172                        ResourceRefR4.generateRandomSub(ScriptResourceH.NAME_PREFIX);  
    145173                final ResourceRefR4 bookRef = bookAccess.getRef(); 
    146                 new AutoAction("Insert script", true) { 
     174                new AutoAction(Message.create(INSERT_SCRIPT), true) { 
    147175                         
    148176                        @Override 
    149177                        public void performAuto() { 
     
    153181                }.register(bookAccess); 
    154182                ResourceAccess scriptAccess = bookAccess.open( 
    155183                                scriptRef, bookAccess.getAccessOptions()); 
    156                 new AutoAction("Edit Script", true) { 
     184                new AutoAction(Message.create(EDIT_SCRIPT), true) { 
    157185                         
    158186                        @Override 
    159187                        public void performAuto() { 
     
    172200                ImmList<LinkRule> rules = ElementR4.KEY_LINK.get(page.getAccess()).getRules(); 
    173201                final Link link = new Link(rules.add(rule)); 
    174202                 
    175                 new AutoAction("Add link rule", true) { 
     203                new AutoAction(Message.create(ADD_LINK_RULE), true) { 
    176204                         
    177205                        @Override 
    178206                        public void performAuto() { 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/page/resize/PageResizeHaloButton.java

     
    1616import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1717import org.sophie2.base.scene.SceneVisual; 
    1818import org.sophie2.base.scene.helpers.SceneHelper; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.base.skins.SkinElementId; 
    2021import org.sophie2.base.visual.BaseVisualElement; 
    2122import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    3233@VisualElementDef(parent = PageResizeHaloMenu.class, sortKey = "kkk-page-resize-halo-button") 
    3334public class PageResizeHaloButton extends MoveHaloButton { 
    3435 
     36        /** 
     37         * Constant created for notifying that a page is resized. 
     38         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     39         * Used for skinning. 
     40         */ 
     41        public static final String PAGE_RESIZE = "Page resize"; 
     42         
     43        /** 
     44         * Constant created for setting page size. 
     45         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     46         * Used for skinning. 
     47         */ 
     48        public static final String SET_PAGE_SIZE = "Set page size"; 
     49 
     50 
    3551        @SuppressWarnings("unused") 
    3652        @SkinPartDef 
    3753        private static void defineSkin(ElementSkinPart part) { 
     
    7187                                        sv.wantedViewRect().set(null); 
    7288 
    7389 
    74                                         new AutoAction("Set page size", true) { 
     90                                        new AutoAction(Message.create(SET_PAGE_SIZE), true) { 
    7591 
    7692                                                @Override 
    7793                                                public void performAuto() { 
     
    104120                                        } 
    105121                                         
    106122                                        final ImmSize value = new ImmSize(width, height); 
    107                                         new AutoAction("Page resize", false) { 
     123                                        new AutoAction(Message.create(PAGE_RESIZE), false) { 
    108124                                                @Override 
    109125                                                public void performAuto() { 
    110126                                                        getChanger().setRaw(BookR4.KEY_PAGE_SIZE, value); 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/TemplatesControlGroup.java

     
    1010import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1111import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    1212import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     13import org.sophie2.base.skins.Message; 
    1314import org.sophie2.base.visual.skins.ElementSkinPart; 
    1415import org.sophie2.base.visual.skins.RelatedChildren; 
    1516import org.sophie2.base.visual.skins.SkinPartDef; 
     
    209210                                TemplatesControlGroup templateGroup = findParentElement(source, TemplatesControlGroup.class); 
    210211                                final ImmList<TemplatedKey<?>> keys = templateGroup.keys().get(); 
    211212                         
    212                                 new AutoAction("Use template", true){ 
     213                                new AutoAction(Message.create(USE_TEMPLATE), true){ 
    213214                                         
    214215                                        @Override 
    215216                                        public void performAuto() { 
     
    255256                                 
    256257                                final ImmList<Object> finalValues = accumultaingValues; 
    257258                                 
    258                                 new AutoAction("Lock", true){ 
     259                                new AutoAction(Message.create(LOCK), true){ 
    259260                                         
    260261                                        @SuppressWarnings("unchecked") 
    261262                                        @Override 
     
    304305                                 
    305306                                final ImmList<Object> finalValues = accumultaingValues; 
    306307                                 
    307                                 new AutoAction("Lock", true){ 
     308                                new AutoAction(Message.create(LOCK), true){ 
    308309                                         
    309310                                        @SuppressWarnings("unchecked") 
    310311                                        @Override 
     
    322323                                return true; 
    323324                        } 
    324325                         
    325                 } 
     326                }; 
     327 
     328                /** 
     329                 * Constant created for expressing lock. 
     330                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     331                 * Used for skinning. 
     332                 */ 
     333                public static final String LOCK = "Lock"; 
    326334                 
     335                /** 
     336                 * Constant created for expressing use template. 
     337                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     338                 * Used for skinning. 
     339                 */ 
     340                public static final String USE_TEMPLATE = "Use template"; 
    327341        } 
    328          
    329          
    330          
    331342} 
  • modules/org.sophie2.main.func.media/src/main/java/org/sophie2/main/func/media/links/MediaActionLogic.java

     
    77import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    88import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    99import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     10import org.sophie2.base.skins.Message; 
    1011import org.sophie2.core.mvc.EventFilterBuilder; 
    1112import org.sophie2.core.mvc.OperationDef; 
    1213import org.sophie2.core.mvc.events.EventR3; 
     
    5152                        MediaFrameView mediaView = getMediaView(bw, mediaFrameAccess.getRef()); 
    5253                        if (mediaView != null) { 
    5354                                MediaState newState = MediaState.DEFAULT_STOPPED; 
    54                                 return setMediaChannel(mediaView, newState, true, "Stop", mediaFrameAccess); 
     55                                return setMediaChannel(mediaView, newState, true, Message.create(STOP), mediaFrameAccess); 
    5556                        } 
    5657                        return false; 
    5758 
     
    8283                        if(mediaView != null) { 
    8384                                MediaState oldState =  mediaView.model().get().getMediaState(mediaView.getTime()); 
    8485                                MediaState newState = oldState.setPlaying(false); 
    85                                 return setMediaChannel(mediaView,newState,true,"Pause",mediaFrameAccess); 
     86                                return setMediaChannel(mediaView, newState, true, Message.create(PAUSE), mediaFrameAccess); 
    8687                        } 
    8788                        return false; 
    8889                } 
     
    112113                        if(mediaView != null) { 
    113114                                MediaState oldState =  mediaView.model().get().getMediaState(mediaView.getTime()); 
    114115                                MediaState newState = oldState.setPlaying(true); 
    115                                 return setMediaChannel(mediaView,newState,true,"Play",mediaFrameAccess); 
     116                                return setMediaChannel(mediaView, newState, true, Message.create(PLAY), mediaFrameAccess); 
    116117 
    117118                        } 
    118119                        return false; 
     
    143144                        if(mediaView != null) { 
    144145                                MediaState oldState = mediaView.model().get().getMediaState(mediaView.getTime()); 
    145146                                MediaState newState = new MediaState(oldState.getVolume(), 0, oldState.isPlaying()); 
    146                                 return setMediaChannel(mediaView,newState,true,"Rewind",mediaFrameAccess); 
     147                                return setMediaChannel(mediaView, newState, true, Message.create(REWIND), mediaFrameAccess); 
    147148 
    148149                        } 
    149150                        return false; 
     
    153154        }; 
    154155         
    155156        /** 
     157         * Constant created for stop. 
     158         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     159         * Used for skinning. 
     160         */ 
     161        public static final String STOP = "Stop"; 
     162         
     163        /** 
     164         * Constant created for pause. 
     165         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     166         * Used for skinning. 
     167         */ 
     168        public static final String PAUSE = "Pause"; 
     169         
     170        /** 
     171         * Constant created for play. 
     172         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     173         * Used for skinning. 
     174         */ 
     175        public static final String PLAY = "Play"; 
     176 
     177        /** 
     178         * Constant created for rewind. 
     179         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     180         * Used for skinning. 
     181         */ 
     182        public static final String REWIND = "Rewind"; 
     183 
     184        /** 
    156185         * Gets the target frame. 
    157186         *  
    158187         * @param event 
     
    193222         * @return true 
    194223         */ 
    195224        boolean setMediaChannel( MediaFrameView mediaView,MediaState newState, 
    196                         boolean significance,String description,ResourceAccess mediaFrameAccess) { 
     225                        boolean significance,Message description,ResourceAccess mediaFrameAccess) { 
    197226 
    198227                TimePos newTime = mediaView.getTime(); 
    199228                MediaStateChannel oldChannel = mediaView.model().get().get(MediaFrameR4.KEY_STATE); 
  • modules/org.sophie2.extra.func.annotations/src/main/java/org/sophie2/extra/func/annotations/logic/StickiesLogic.java

     
    1313import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1414import org.sophie2.base.model.resources.r4.ResourceUtil; 
    1515import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.core.mvc.EventFilterBuilder; 
    1718import org.sophie2.core.mvc.OperationDef; 
    1819import org.sophie2.core.mvc.events.EventR3; 
     
    7374                                                final ImmPoint location = PageExtraH.DEFAULT_ELEMENT_LOCATION; 
    7475                                                final ResourceRefList pageExtras = currentBookExtra.getPageExtras(); 
    7576 
    76                                                 new AutoAction("Create page extra with sticky", true) { 
     77                                                new AutoAction(Message.create(CREATE_PAGE_EXTRA_WITH_STICKY), true) { 
    7778 
    7879                                                        @Override 
    7980                                                        public void performAuto() {  
     
    9192                                                        curPageExtra.get(CompositeElement.KEY_SUB_ELEMENTS); 
    9293                                                final ImmPoint location = curPageExtra.selectInsertLocation(); 
    9394 
    94                                                 new AutoAction("Create new sticky.", true) { 
     95                                                new AutoAction(Message.create(CREATE_NEW_STICKY), true) { 
    9596 
    9697                                                        @Override 
    9798                                                        public void performAuto() { 
     
    150151                                        pageExtra.get(CompositeElement.KEY_SUB_ELEMENTS); 
    151152                                final ActivationChannel chan = pageExtra.getActivationChannel(stickyRef);  
    152153 
    153                                 new AutoAction("Delete sticky.", true) { 
     154                                new AutoAction(Message.create(DELETE_STICKY), true) { 
    154155 
    155156                                        @Override 
    156157                                        public void performAuto() { 
     
    167168 
    168169        }; 
    169170 
     171        /** 
     172         * Constant created for deleting of a sticky. 
     173         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     174         * Used for skinning. 
     175         */ 
     176        public static final String DELETE_STICKY = "Delete sticky."; 
     177         
     178        /** 
     179         * Constant created for creation of a new sticky. 
     180         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     181         * Used for skinning. 
     182         */ 
     183        public static final String CREATE_NEW_STICKY = "Create new sticky."; 
     184         
     185        /** 
     186         * Constant created for creation of a page extra with a sticky. 
     187         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     188         * Used for skinning. 
     189         */ 
     190        public static final String CREATE_PAGE_EXTRA_WITH_STICKY = "Create page extra with sticky"; 
     191 
    170192 
    171193} 
  • modules/org.sophie2.dev/src/test/java/org/sophie2/dev/author/ResourceChooserDemo.java

     
    2828import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2929import org.sophie2.base.model.text.BaseModelTextModule; 
    3030import org.sophie2.base.skins.BaseSkinsModule; 
     31import org.sophie2.base.skins.Message; 
    3132import org.sophie2.base.visual.BaseVisualModule; 
    3233import org.sophie2.base.visual.VisualElement; 
    3334import org.sophie2.core.logging.LogLevel; 
     
    5960 */ 
    6061public class ResourceChooserDemo extends AppTestBase { 
    6162 
    62          
     63        /** 
     64         * Constant created for creation of fictive resources. 
     65         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     66         * Used for skinning. Used in the test. 
     67         */ 
     68        public static final String CREATING_FICTIVE_RESOURCES = "Creating fictive resources"; 
     69 
    6370        /** 
    6471         * A {@link ResourceChooser} implementation used by the demo. 
    6572         *  
     
    251258                final ResourceRefR4 audioRef2 =  
    252259                        ResourceRefR4.generateRandomSub(AudioResourceR4.KIND); 
    253260                 
    254                 new AutoAction("Creating fictive resources", true) { 
     261                new AutoAction(Message.create(CREATING_FICTIVE_RESOURCES), true) { 
    255262 
    256263                        @Override 
    257264                        public void performAuto() { 
  • modules/org.sophie2.main.func.resources/src/main/java/org/sophie2/main/func/resources/logic/ChangeBackgroundHandler.java

     
    99import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1010import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1111import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
     12import org.sophie2.base.skins.Message; 
    1213import org.sophie2.main.app.commons.element.ElementDropHandler; 
    1314import org.sophie2.main.app.commons.element.ElementView; 
    1415import org.sophie2.main.dnd.dnddata.ResourceRefData; 
     
    2223 */ 
    2324public class ChangeBackgroundHandler extends ElementDropHandler<ElementView> { 
    2425         
     26        /** 
     27         * Constant created for setting image background. 
     28         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     29         * Used for skinning. 
     30         */ 
     31        public static final String SET_IMAGE_BG = "Set image background"; 
    2532        private static ChangeBackgroundHandler instance = null; 
    2633         
    2734        private ChangeBackgroundHandler() { 
     
    6269                final ResourceRefR4 elementToImageRef =  
    6370                        ResourceRefR4.getRelativeRef(absElementRef, absImageRef); 
    6471         
    65                 new AutoAction("Set image background", true) { 
     72                new AutoAction(Message.create(SET_IMAGE_BG), true) { 
    6673 
    6774                        @Override 
    6875                        public void performAuto() { 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/PageUnitTest.java

     
    1313import org.sophie2.base.model.book.timelines.ActivationChannel; 
    1414import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1515import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     16import org.sophie2.base.skins.Message; 
    1617 
    1718/** 
    1819 * Test for {@link PageH}. 
     
    2122 */ 
    2223public class PageUnitTest extends ModelTestBase { 
    2324 
     25        /** 
     26         * Constant created for adding a null frame. 
     27         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     28         * Used for skinning. Used in the test. 
     29         */ 
     30        public static final String ADD_NULL_FRAME = "Add a nullFrame"; 
    2431        private PageH page; 
    2532 
    2633        @Override 
     
    5764                try { 
    5865                        final ImmList<ActivationChannel> channels = CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    5966                         
    60                         new AutoAction("Add a nullFrame", true) { 
     67                        new AutoAction(Message.create(ADD_NULL_FRAME), true) { 
    6168 
    6269                                @Override 
    6370                                public void performAuto() { 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/frame/MainTitleBarHalo.java

     
    3232import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
    3333import org.sophie2.base.scene.SceneVisual; 
    3434import org.sophie2.base.scene.helpers.SceneHelper; 
     35import org.sophie2.base.skins.Message; 
    3536import org.sophie2.base.skins.SkinElementId; 
    3637import org.sophie2.base.visual.BaseVisualElement; 
    3738import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    6263@VisualElementDef(parent = MainHaloMenu.class, sortKey = "yyy-main-title-bar-halo") 
    6364public class MainTitleBarHalo extends AbstractHalo { 
    6465 
     66        /** 
     67         * Constant created for setting location. 
     68         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     69         * Used for skinning. 
     70         */ 
     71        public static final String SET_LOCATION = "Set location."; 
    6572        private static ImmColor BASIC_COLOR = new ImmColor(0.5f, 0.5f, 1f, 0.5f); 
    6673        private static ImmColor SELECTED_COLOR = new ImmColor(0.25f, 0.25f, 1f, 0.7f); 
    6774 
     
    296303                                        final ResourceRefList refs, ImmList<TimePos> times) { 
    297304                                if (currentPage().get() != null) { 
    298305                                        ResourceAccess pageAccess = currentPage().get().getAccess(); 
    299                                         AutoAction.registerEndChange(pageAccess, "Set location."); 
     306                                        AutoAction.registerEndChange(pageAccess, Message.create(SET_LOCATION)); 
    300307                                } 
    301308 
    302309                        } 
     
    320327                                                MemberElement.KEY_LOCATION.get(frameAccess); 
    321328                                        final TimePos time = times.get(i); 
    322329 
    323                                         new AutoAction("Set location.", false) { 
     330                                        new AutoAction(Message.create(SET_LOCATION), false) { 
    324331                                                @Override 
    325332                                                public void performAuto() { 
    326333                                                        ResourceChanger subChanger = getChanger().getSub(frameRef); 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/properties/OrientationHud.java

     
    2929import org.sophie2.base.model.book.timelines.LocationChannel; 
    3030import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    3131import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     32import org.sophie2.base.skins.Message; 
    3233import org.sophie2.base.skins.SkinElementId; 
    3334import org.sophie2.base.visual.BaseSwingVisualElement; 
    3435import org.sophie2.base.visual.BaseVisualElement; 
     
    495496                                        MemberElement.KEY_LOCATION.getMode(frame.getAccess()) == Mode.USE_TEMPLATE; 
    496497                                if (wasTemplated) { 
    497498                                        final LocationChannel oldChannel = frame.get(MemberElement.KEY_LOCATION); 
    498                                         new AutoAction("Rotate frame (untemplate)", true) { 
     499                                        new AutoAction(Message.create(ROTATE_FRAME_UNTEMPLATE), true) { 
    499500 
    500501                                                @Override 
    501502                                                public void performAuto() { 
     
    508509                                                } 
    509510                                        }.register(frame.getAccess()); 
    510511                                } else { 
    511                                         new AutoAction("Rotate frame (own)", true) { 
     512                                        new AutoAction(Message.create(ROTATE_FRAME_OWN), true) { 
    512513 
    513514                                                @Override 
    514515                                                public void performAuto() { 
     
    527528                                return true; 
    528529                        } 
    529530                         
    530                 } 
     531                }; 
     532 
     533                /** 
     534                 * Constant created for rotation of a frame. 
     535                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     536                 * Used for skinning. 
     537                 */ 
     538                public static final String ROTATE_FRAME_OWN = "Rotate frame (own)"; 
     539 
     540                /** 
     541                 * Constant created for rotation of frame that is not templated. 
     542                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     543                 * Used for skinning. 
     544                 */ 
     545                public static final String ROTATE_FRAME_UNTEMPLATE = "Rotate frame (untemplate)"; 
    531546        } 
    532547} 
  • modules/org.sophie2.main.func.links/src/main/java/org/sophie2/main/func/links/actions/showing/ShowingActionLogic.java

     
    99import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1010import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1111import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     12import org.sophie2.base.skins.Message; 
    1213import org.sophie2.core.mvc.EventFilterBuilder; 
    1314import org.sophie2.core.mvc.OperationDef; 
    1415import org.sophie2.core.mvc.events.EventR3; 
     
    4344                        }                
    4445                        final VisibleChannel channel = ElementR4.KEY_VISIBLE.get(frameAccess);                           
    4546                         
    46                         new AutoAction("Show frame.", true) {                                    
     47                        new AutoAction(Message.create(SHOW_FRAME), true) {                                       
    4748                                @Override 
    4849                                public void performAuto() { 
    4950                                        getChanger().setRaw( 
     
    7576                        } 
    7677                        final VisibleChannel channel = ElementR4.KEY_VISIBLE.get(frameAccess);                           
    7778                         
    78                         new AutoAction("Hide frame.", true) {                                    
     79                        new AutoAction(Message.create(HIDE_FRAME), true) {                                       
    7980                                @Override 
    8081                                public void performAuto() { 
    8182                                        getChanger().setRaw( 
     
    108109                        final VisibleChannel channel = ElementR4.KEY_VISIBLE.get(frameAccess);                           
    109110                        final Boolean visible = !channel.getValue(TimePos.INTRO_START); 
    110111                         
    111                         new AutoAction("Toggle frame visibility.", true) {                                       
     112                        new AutoAction(Message.create(TOGGLE_FRAME_VISIBILITY), true) {                                  
    112113                                @Override 
    113114                                public void performAuto() { 
    114115                                        getChanger().setRaw( 
     
    122123        }; 
    123124 
    124125        /** 
     126         * Constant created for toggling frame visibility. 
     127         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     128         * Used for skinning. 
     129         */ 
     130        public static final String TOGGLE_FRAME_VISIBILITY = "Toggle frame visibility."; 
     131         
     132        /** 
     133         * Constant created for hiding frame. 
     134         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     135         * Used for skinning. 
     136         */ 
     137        public static final String HIDE_FRAME = "Hide frame."; 
     138         
     139        /** 
     140         * Constant created for showing frame. 
     141         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     142         * Used for skinning. 
     143         */ 
     144        public static final String SHOW_FRAME = "Show frame."; 
     145 
     146        /** 
    125147         * Gets the {@link ResourceAccess} of the target frame of the 
    126148         *  {@link FrameShowingAction}  
    127149         *  
  • modules/org.sophie2.main.func.media/src/main/java/org/sophie2/main/func/media/view/controls/MediaPropertiesHud.java

     
    1616import org.sophie2.base.halos.HudDialog; 
    1717import org.sophie2.base.halos.HudTitleBar; 
    1818import org.sophie2.base.layout.LogicR3ToggleButton; 
     19import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1920import org.sophie2.base.model.resources.r4.keys.Key; 
     21import org.sophie2.base.skins.Message; 
    2022import org.sophie2.base.skins.SkinElementId; 
    2123import org.sophie2.base.visual.skins.ElementSkinPart; 
    2224import org.sophie2.base.visual.skins.RelatedChildren; 
     
    389391        @VisualElementDef(parent = MediaPropertiesHud.class, sortKey = "hhh-show-play-pause-button") 
    390392        public static class ShowPlayPauseButton extends LogicR3ToggleButton { 
    391393                 
     394                /** 
     395                 * Constant created for showing play/pause button. 
     396                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     397                 * Used for skinning. 
     398                 */ 
     399                public static final String SHOW_PLAY_PAUSE_BUTTON = "Show Play/Pause button"; 
     400                 
     401                /** 
     402                 * Constant created for hiding play/pause button. 
     403                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     404                 * Used for skinning. 
     405                 */ 
     406                public static final String HIDE_PLAY_PAUSE_BUTTON = "Hide Play/Pause button"; 
     407 
    392408                @SuppressWarnings("unused") 
    393409                @SkinPartDef 
    394410                private static void initSkin(ElementSkinPart part) { 
     
    418434                protected ImmList<EventR3> computeDeselectedEvents() { 
    419435                        return ImmTreeList.<EventR3>create(new EventR3( 
    420436                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    421                                         MediaFrameR4.KEY_SHOW_PLAY_BUTTON, "Hide Play/Pause button", false)); 
     437                                        MediaFrameR4.KEY_SHOW_PLAY_BUTTON, Message.create(HIDE_PLAY_PAUSE_BUTTON), false)); 
    422438                } 
    423439 
    424440                @Override 
    425441                protected ImmList<EventR3> computeSelectedEvents() { 
    426442                        return ImmTreeList.<EventR3>create(new EventR3( 
    427443                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    428                                         MediaFrameR4.KEY_SHOW_PLAY_BUTTON, "Show Play/Pause button", true)); 
     444                                        MediaFrameR4.KEY_SHOW_PLAY_BUTTON, Message.create(SHOW_PLAY_PAUSE_BUTTON), true)); 
    429445                } 
    430446        } 
    431447         
     
    437453        @VisualElementDef(parent = MediaPropertiesHud.class, sortKey = "iii-show-stop-button") 
    438454        public static class ShowStopButton extends LogicR3ToggleButton { 
    439455                 
     456                /** 
     457                 * Constant created for showing stop button. 
     458                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     459                 * Used for skinning. 
     460                 */ 
     461                public static final String SHOW_STOP_BUTTON = "Show Stop button"; 
     462                 
     463                /** 
     464                 * Constant created for hiding stop button. 
     465                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     466                 * Used for skinning. 
     467                 */ 
     468                public static final String HIDE_STOP_BUTTON = "Hide Stop button"; 
     469 
    440470                @SuppressWarnings("unused") 
    441471                @SkinPartDef 
    442472                private static void initSkin(ElementSkinPart part) { 
     
    465495                protected ImmList<EventR3> computeDeselectedEvents() { 
    466496                        return ImmTreeList.<EventR3>create(new EventR3( 
    467497                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    468                                         MediaFrameR4.KEY_SHOW_STOP_BUTTON, "Hide Stop button", false)); 
     498                                        MediaFrameR4.KEY_SHOW_STOP_BUTTON, Message.create(HIDE_STOP_BUTTON), false)); 
    469499                } 
    470500 
    471501                @Override 
    472502                protected ImmList<EventR3> computeSelectedEvents() { 
    473503                        return ImmTreeList.<EventR3>create(new EventR3( 
    474504                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    475                                         MediaFrameR4.KEY_SHOW_STOP_BUTTON, "Show Stop button", true)); 
     505                                        MediaFrameR4.KEY_SHOW_STOP_BUTTON, Message.create(SHOW_STOP_BUTTON), true)); 
    476506                } 
    477507        } 
    478508         
     
    484514        @VisualElementDef(parent = MediaPropertiesHud.class, sortKey = "jjj-show-seekbar") 
    485515        public static class ShowSeekBar extends LogicR3ToggleButton { 
    486516                 
     517                /** 
     518                 * Constant created for showing seekbar. 
     519                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     520                 * Used for skinning. 
     521                 */ 
     522                public static final String SHOW_SEEKBAR = "Show seekbar"; 
     523                 
     524                /** 
     525                 * Constant created for hiding seekbar. 
     526                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     527                 * Used for skinning. 
     528                 */ 
     529                public static final String HIDE_SEEKBAR = "Hide seekbar"; 
     530 
    487531                @SuppressWarnings("unused") 
    488532                @SkinPartDef 
    489533                private static void initSkin(ElementSkinPart part) { 
     
    512556                protected ImmList<EventR3> computeDeselectedEvents() { 
    513557                        return ImmTreeList.<EventR3>create(new EventR3( 
    514558                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    515                                         MediaFrameR4.KEY_SHOW_SEEKBAR, "Hide seekbar", false)); 
     559                                        MediaFrameR4.KEY_SHOW_SEEKBAR, Message.create(HIDE_SEEKBAR), false)); 
    516560                } 
    517561 
    518562                @Override 
    519563                protected ImmList<EventR3> computeSelectedEvents() { 
    520564                        return ImmTreeList.<EventR3>create(new EventR3( 
    521565                                        this, null, null, null, EventIds.TOGGLE_CONTROL, 
    522                                         MediaFrameR4.KEY_SHOW_SEEKBAR, "Show seekbar", true)); 
     566                                        MediaFrameR4.KEY_SHOW_SEEKBAR, Message.create(SHOW_SEEKBAR), true)); 
    523567                } 
    524568        } 
    525569         
     
    538582                 * be registered. The third parameter determines whether the control should be shown 
    539583                 * or hidden. 
    540584                 */ 
    541                 @EventParams({ Key.class, String.class, Boolean.class }) 
     585                @EventParams({ Key.class, Message.class, Boolean.class }) 
    542586                TOGGLE_CONTROL; 
    543587                 
    544588                /** 
  • modules/org.sophie2.extra.comment/src/main/java/org/sophie2/extra/comment/logic/CommentLogic.java

     
    66import org.sophie2.base.model.resources.r4.LocationPrefix; 
    77import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     9import org.sophie2.base.skins.Message; 
    910import org.sophie2.base.visual.interaction.InputEventR3; 
    1011import org.sophie2.core.logging.SophieLog; 
    1112import org.sophie2.core.mvc.EventFilterBuilder; 
     
    149150                                return false; 
    150151                        } 
    151152 
    152                         new AutoAction("Add commment reply.", true) { 
     153                        new AutoAction(Message.create(ADD_COMMMENT_REPLY), true) { 
    153154 
    154155                                @Override 
    155156                                public void performAuto() { 
     
    201202                                return true; 
    202203                        } 
    203204 
    204                         new AutoAction("Add new commment.", true) { 
     205                        new AutoAction(Message.create(ADD_NEW_COMMMENT), true) { 
    205206 
    206207                                @Override 
    207208                                public void performAuto() { 
     
    251252                                        final ResourceRefR4 valueToSet =   
    252253                                                frameView.model().get().getCommentStreamH().getRef();  
    253254 
    254                                         new AutoAction("Update comment frame reference.", false) {  
     255                                        new AutoAction(Message.create(UPDATE_COMMENT_FRAME_REFERENCE), false) {  
    255256                                                public void performAuto() {  
    256257                                                        getChanger().getSub(relRef).setRaw(  
    257258                                                                        ResourceFrame.KEY_MAIN_RESOURCE, valueToSet);  
     
    270271                         
    271272                        return true;  
    272273                }                
    273         } 
     274        }; 
     275 
     276        /** 
     277         * Constant created for updating of a comment frame reference. 
     278         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     279         * Used for skinning. 
     280         */ 
     281        public static final String UPDATE_COMMENT_FRAME_REFERENCE = "Update comment frame reference."; 
     282         
     283        /** 
     284         * Constant created for adding new comment. 
     285         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     286         * Used for skinning. 
     287         */ 
     288        public static final String ADD_NEW_COMMMENT = "Add new commment."; 
     289         
     290        /** 
     291         * Constant created for adding a comment reply. 
     292         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     293         * Used for skinning. 
     294         */ 
     295        public static final String ADD_COMMMENT_REPLY = "Add commment reply."; 
    274296} 
  • modules/org.sophie2.main.func.resources/src/test/java/org/sophie2/main/func/resources/imports/ResourceImportManagerTest.java

     
    2929import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    3030import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    3131import org.sophie2.base.skins.BaseSkinsModule; 
     32import org.sophie2.base.skins.Message; 
    3233import org.sophie2.base.visual.BaseVisualModule; 
    3334import org.sophie2.core.modularity.FileEntryManager; 
    3435import org.sophie2.core.modularity.SophieModule; 
     
    5253 */ 
    5354public class ResourceImportManagerTest extends AppTestBase { 
    5455         
     56        /** 
     57         * Constant created for inserting the frame. 
     58         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     59         * Used for skinning. Used in the test. 
     60         */ 
     61        public static final String INSERT_THE_FRAME = "Insert the frame."; 
     62 
     63        /** 
     64         * Constant created for creating cold text. 
     65         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     66         * Used for skinning. 
     67         */ 
     68        public static final String CREATING_COLD_TEXT = "Creating cold text"; 
     69 
    5570        private ResourceImportProvider provider; 
    5671         
    5772        /** 
     
    168183                        ResourceRefR4.generateRandomSub(ColdTextResource.DEFAULT_TITLE); 
    169184                final String text = "Some text"; 
    170185                 
    171                 new AutoAction("Creating cold text", true) { 
     186                new AutoAction(Message.create(CREATING_COLD_TEXT), true) { 
    172187                        @Override 
    173188                        public void performAuto() { 
    174189                                ColdTextResourceHelper.createColdText( 
     
    192207                        ResourceRefR4.generateRandomSub(FrameH.NAME_PREFIX); 
    193208                final ImmList<ActivationChannel> elements = ImmTreeList.empty(); 
    194209                 
    195                 new AutoAction("Insert the frame.", true) { 
     210                new AutoAction(Message.create(INSERT_THE_FRAME), true) { 
    196211                        @Override 
    197212                        public void performAuto() { 
    198213                                manager.insertFrame(getChanger().getSub(parentRef), 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/FrameSizeLocationTest.java

     
    1515import org.sophie2.base.model.book.timelines.LocationChannel; 
    1616import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1717import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     18import org.sophie2.base.skins.Message; 
    1819 
    1920/** 
    2021 * Common tests for size and location functionalities in {@link FrameH}.  
     
    2324 */ 
    2425public class FrameSizeLocationTest extends ModelTestBase { 
    2526         
     27        /** 
     28         * Constant created for BLAH. 
     29         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     30         * Used for skinning. 
     31         */ 
     32        public static final String BLAH = "Blah"; 
    2633        private FrameH frame; 
    2734         
    2835        @Override 
     
    4855                final ImmInsets testMarginInsets = new ImmInsets(40.f, 10.f, 20.f, 30.f); 
    4956 
    5057                 
    51                 new AutoAction("Blah", true) { 
     58                new AutoAction(Message.create(BLAH), true) { 
    5259                         
    5360                        @Override 
    5461                        public void performAuto() { 
     
    117124                final ImmInsets testMarginInsets = new ImmInsets(topMarginWidth, 
    118125                                leftMarginWidth, bottomMarginWidth, rightMarginWidth); 
    119126                 
    120                 new AutoAction("Blah", true) { 
     127                new AutoAction(Message.create(BLAH), true) { 
    121128                         
    122129                        @Override 
    123130                        public void performAuto() { 
  • modules/org.sophie2.main.func.timelines/src/main/java/org/sophie2/main/func/timelines/hud/ChildRow.java

     
    2424import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    2525import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    2626import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     27import org.sophie2.base.skins.Message; 
    2728import org.sophie2.base.visual.BaseSwingVisualElement; 
    2829import org.sophie2.base.visual.SwingVisualElement; 
    2930import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    489490                                final ImmList<ActivationChannel> newChannels = createActivationChannels( 
    490491                                                newPhase, inputData, access, row); 
    491492 
    492                                 new AutoAction("Add activation channel entry", true) { 
     493                                new AutoAction(Message.create(ADD_ACTIVATION_CHANNEL_ENTRY), true) { 
    493494 
    494495                                        @Override 
    495496                                        public void performAuto() { 
     
    551552                                                Phase.valueOf(inputData.getSelectedItem()), 
    552553                                                currentValue, access, row); 
    553554 
    554                                 new AutoAction("Set child timeline options", true) { 
     555                                new AutoAction(Message.create(SET_CHILD_TIMELINE_OPTIONS), true) { 
    555556 
    556557                                        @Override 
    557558                                        public void performAuto() { 
     
    567568                }; 
    568569 
    569570                /** 
     571                 * Constant created for setting child timeline options. 
     572                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     573                 * Used for skinning. 
     574                 */ 
     575                public static final String SET_CHILD_TIMELINE_OPTIONS = "Set child timeline options"; 
     576                 
     577                /** 
     578                 * Constant created for adding activation channel entry. 
     579                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     580                 * Used for skinning. 
     581                 */ 
     582                public static final String ADD_ACTIVATION_CHANNEL_ENTRY = "Add activation channel entry"; 
     583 
     584                /** 
    570585                 * Helper method to create an {@link ImmList} with the 
    571586                 * {@link ActivationChannel}s to be set 
    572587                 *  
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/huds/properties/InsetsHud.java

     
    1717import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1818import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    1919import org.sophie2.base.model.resources.r4.keys.TemplatedKey.Mode; 
     20import org.sophie2.base.skins.Message; 
    2021import org.sophie2.base.skins.SkinElementId; 
    2122import org.sophie2.base.visual.VisualElement; 
    2223import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    467468                                ResourceAccess access = getAccess(source); 
    468469                                String input = event.getEventParam( 
    469470                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    470                                 setFrameInsetsComponent(Side.TOP, input, "Set top padding.", 
     471                                setFrameInsetsComponent(Side.TOP, input, Message.create(SET_TOP_PADDING), 
    471472                                                access, FrameR4.KEY_PADDING_INSETS); 
    472473                                return true; 
    473474                        } 
     
    487488                                ResourceAccess access = getAccess(source); 
    488489                                String input = event.getEventParam( 
    489490                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    490                                 setFrameInsetsComponent(Side.RIGHT, input, "Set right padding.", 
     491                                setFrameInsetsComponent(Side.RIGHT, input, Message.create(SET_RIGHT_PADDING), 
    491492                                                access, FrameR4.KEY_PADDING_INSETS); 
    492493                                return true; 
    493494                        } 
     
    508509                                ResourceAccess access = getAccess(source); 
    509510                                String input = event.getEventParam( 
    510511                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    511                                 setFrameInsetsComponent(Side.BOTTOM, input, "Set bottom padding.", 
     512                                setFrameInsetsComponent(Side.BOTTOM, input, Message.create(SET_BOTTOM_PADDING), 
    512513                                                access, FrameR4.KEY_PADDING_INSETS); 
    513514                                return true; 
    514515                        } 
     
    528529                                ResourceAccess access = getAccess(source); 
    529530                                String input = event.getEventParam( 
    530531                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    531                                 setFrameInsetsComponent(Side.LEFT, input, "Set left padding.", 
     532                                setFrameInsetsComponent(Side.LEFT, input, Message.create(SET_LEFT_PADDING), 
    532533                                                access, FrameR4.KEY_PADDING_INSETS); 
    533534                                return true; 
    534535                        } 
     
    548549                                ResourceAccess access = getAccess(source); 
    549550                                String input = event.getEventParam( 
    550551                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    551                                 setFrameInsetsComponent(Side.TOP, input, "Set top margin.", 
     552                                setFrameInsetsComponent(Side.TOP, input, Message.create(SET_TOP_MARGIN), 
    552553                                                access, FrameR4.KEY_MARGIN_INSETS); 
    553554                                return true; 
    554555                        } 
     
    569570                                ResourceAccess access = getAccess(source); 
    570571                                String input = event.getEventParam( 
    571572                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    572                                 setFrameInsetsComponent(Side.RIGHT, input, "Set right margin.", 
     573                                setFrameInsetsComponent(Side.RIGHT, input, Message.create(SET_RIGHT_MARGIN), 
    573574                                                access, FrameR4.KEY_MARGIN_INSETS); 
    574575                                return true; 
    575576                        } 
     
    590591                                ResourceAccess access = getAccess(source); 
    591592                                String input = event.getEventParam( 
    592593                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    593                                 setFrameInsetsComponent(Side.BOTTOM, input, "Set bottom margin.", 
     594                                setFrameInsetsComponent(Side.BOTTOM, input, Message.create(SET_BOTTOM_MARGIN), 
    594595                                                access, FrameR4.KEY_MARGIN_INSETS); 
    595596                                return true; 
    596597                        } 
     
    611612                                ResourceAccess access = getAccess(source); 
    612613                                String input = event.getEventParam( 
    613614                                                BoundControl.EventIds.INPUT_PARAM_INDEX, String.class); 
    614                                 setFrameInsetsComponent(Side.LEFT, input, "Set left margin.", 
     615                                setFrameInsetsComponent(Side.LEFT, input, Message.create(SET_LEFT_MARGIN), 
    615616                                                access, FrameR4.KEY_MARGIN_INSETS); 
    616617                                return true; 
    617618                        } 
    618                 }, 
     619                }; 
     620 
     621                /** 
     622                 * Constant created for setting top padding. 
     623                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     624                 * Used for skinning. 
     625                 */ 
     626                public static final String SET_TOP_PADDING = "Set top padding."; 
    619627                 
     628                /** 
     629                 * Constant created for setting right padding. 
     630                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     631                 * Used for skinning. 
     632                 */ 
     633                public static final String SET_RIGHT_PADDING = "Set right padding."; 
     634                 
     635                /** 
     636                 * Constant created for setting bottom padding. 
     637                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     638                 * Used for skinning. 
     639                 */ 
     640                public static final String SET_BOTTOM_PADDING = "Set bottom padding."; 
     641                 
     642                /** 
     643                 * Constant created for setting left padding. 
     644                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     645                 * Used for skinning. 
     646                 */ 
     647                public static final String SET_LEFT_PADDING = "Set left padding."; 
     648                 
     649                /** 
     650                 * Constant created for setting top margin. 
     651                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     652                 * Used for skinning. 
     653                 */ 
     654                public static final String SET_TOP_MARGIN = "Set top margin."; 
     655                 
     656                /** 
     657                 * Constant created for setting tight margin. 
     658                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     659                 * Used for skinning. 
     660                 */ 
     661                public static final String SET_RIGHT_MARGIN = "Set right margin."; 
     662                 
     663                /** 
     664                 * Constant created for setting bottom margin. 
     665                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     666                 * Used for skinning. 
     667                 */ 
     668                public static final String SET_BOTTOM_MARGIN = "Set bottom margin."; 
     669                 
     670                /** 
     671                 * Constant created for setting left margin. 
     672                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     673                 * Used for skinning. 
     674                 */ 
     675                public static final String SET_LEFT_MARGIN = "Set left margin."; 
    620676        } 
    621677 
    622678        /** 
     
    635691         *            The key of the insets of the frame. 
    636692         */ 
    637693        protected static void setFrameInsetsComponent(Side side, String input, 
    638                         String eventDescription, ResourceAccess access, 
     694                        Message eventDescription, ResourceAccess access, 
    639695                        final TemplatedKey<ImmInsets> key) { 
    640696                ImmInsets insets = key.get(access); 
    641697                float value = BoundValidation.parseNumber(input, Float.class); 
     
    655711         * @param key 
    656712         *            The key of the insets of the frame. 
    657713         */ 
    658         protected static void setFrameInsets(final ImmInsets insets, String eventDescription, 
     714        protected static void setFrameInsets(final ImmInsets insets, Message eventDescription, 
    659715                        ResourceAccess access, final TemplatedKey<ImmInsets> key) { 
    660716                new AutoAction(eventDescription, true) { 
    661717                        @Override 
  • modules/org.sophie2.main.func.media/src/test/java/org/sophie2/main/func/media/model/resources/MediaPersistenceTest.java

     
    2828import org.sophie2.base.persistence.persister.MasterPersister; 
    2929import org.sophie2.base.persistence.ref.ValueRef; 
    3030import org.sophie2.base.persistence.storage.Storage; 
     31import org.sophie2.base.skins.Message; 
    3132import org.sophie2.core.logging.LogLevel; 
    3233import org.sophie2.core.logging.SophieLog; 
    3334import org.sophie2.core.modularity.FileEntryManager; 
     
    5051public class MediaPersistenceTest extends ModelTestBase { 
    5152 
    5253        /** 
     54         * Constant created for creating audio resource. 
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. 
     57         */ 
     58        public static final String CREATING_AUDIO_RESOURCE = "Creating audio resource."; 
     59 
     60        /** 
    5361         * Matches the {@link AudioImportManager}'s provider 
    5462         * form all the registered as extensions providers.  
    5563         *  
     
    213221                        new ResourceImportInfo<BinData>(binData, 
    214222                                        this.testFile.getName()); 
    215223                 
    216                 new AutoAction("Creating audio resource.", true) { 
     224                new AutoAction(Message.create(CREATING_AUDIO_RESOURCE), true) { 
    217225                        @Override 
    218226                        public void performAuto() { 
    219227                                audioImportManager.makeResource(getChanger(), audioRef, info); 
     
    240248                        new ResourceImportInfo<ResourceModel>(model, 
    241249                                        sophieMediaFile.getName()); 
    242250                 
    243                 new AutoAction("Creating audio resource.", true) { 
     251                new AutoAction(Message.create(CREATING_AUDIO_RESOURCE), true) { 
    244252                        @Override 
    245253                        public void performAuto() { 
    246254                                sophieManager.makeResource(getChanger(), audioRef, info); 
  • modules/org.sophie2.main.app.halos/src/test/java/org/sophie2/main/app/halos/frame/rotate/FrameRotateHaloButtonTest.java

     
    2222import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2323import org.sophie2.base.scene.BaseSceneModule; 
    2424import org.sophie2.base.skins.BaseSkinsModule; 
     25import org.sophie2.base.skins.Message; 
    2526import org.sophie2.base.visual.BaseVisualModule; 
    2627import org.sophie2.core.logging.LogLevel; 
    2728import org.sophie2.core.logging.SophieLog; 
     
    4546 */ 
    4647public class FrameRotateHaloButtonTest extends AppTestBase { 
    4748         
     49        /** 
     50         * Constant created for changing size. 
     51         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     52         * Used for skinning. 
     53         */ 
     54        public static final String CHANGE_SIZE = "Change size"; 
     55 
    4856        private FrameH frame; 
    4957         
    5058        private FrameView fv; 
     
    6472                this.frame = makeFrame(pageAccess); 
    6573                 
    6674                // a square frame will be easier for testing 
    67                 new AutoAction("Change size", true) { 
     75                new AutoAction(Message.create(CHANGE_SIZE), true) { 
    6876 
    6977                        @Override 
    7078                        public void performAuto() { 
  • modules/org.sophie2.extra.func.scripting/src/test/java/org/sophie2/extra/func/scripting/logic/ScriptingLogicTest.java

     
    2424import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2525import org.sophie2.base.persistence.BasePersistenceModule; 
    2626import org.sophie2.base.skins.BaseSkinsModule; 
     27import org.sophie2.base.skins.Message; 
    2728import org.sophie2.base.visual.BaseVisualModule; 
    2829import org.sophie2.core.modularity.SophieModule; 
    2930import org.sophie2.core.mvc.CoreMvcModule; 
     
    5354 */ 
    5455public class ScriptingLogicTest extends AppTestBase { 
    5556 
     57        /** 
     58         * Constant created for inserting a script from a file. 
     59         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     60         * Used for skinning. Used in the test. 
     61         */ 
     62        public static final String INSERT_SCRIPT_FROM_FILE = "Insert script from a file."; 
    5663        private BookH book; 
    5764         
    5865        @Override 
     
    180187                        ResourceRefR4.generateRandomSub(ScriptResourceH.NAME_PREFIX); 
    181188                final ResourceRefR4 bookRef = bookAccess.getRef(); 
    182189 
    183                 new AutoAction("Insert script from a file.", true) { 
     190                new AutoAction(Message.create(INSERT_SCRIPT_FROM_FILE), true) { 
    184191                        @Override 
    185192                        public void performAuto() { 
    186193                                ScriptResourceH.create(getChanger(), scriptRef, SAMPLE_SCRIPT, bookRef); 
  • modules/org.sophie2.main.app.menus/src/main/java/org/sophie2/main/app/menus/file/FileMenuLogic.java

     
    1212import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1313import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    1414import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     15import org.sophie2.base.skins.Message; 
    1516import org.sophie2.core.logging.SophieLog; 
    1617import org.sophie2.core.modularity.SortKey; 
    1718import org.sophie2.core.mvc.EventFilterBuilder; 
     
    159160 
    160161                                SophieLog.debug("Setting new book properties: " + newTitle + " / " + newPageSize  
    161162                                                + " / " + newBgAudio); 
    162                                 new AutoAction("Change book properties", true) { 
     163                                new AutoAction(Message.create(CHANGE_BOOK_PROPERTIES), true) { 
    163164 
    164165                                        @Override 
    165166                                        public void performAuto() { 
     
    220221                } 
    221222 
    222223        }; 
     224 
     225        /** 
     226         * Constant created for changing book properties. 
     227         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     228         * Used for skinning. 
     229         */ 
     230        public static final String CHANGE_BOOK_PROPERTIES = "Change book properties"; 
    223231} 
  • modules/org.sophie2.main.func.templates/src/main/java/org/sophie2/main/func/templates/page/ApplyPageTemplateHandler.java

     
    1313import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1414import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1515import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.main.app.commons.book.BookView; 
    1718import org.sophie2.main.app.commons.element.ElementDropHandler; 
    1819import org.sophie2.main.app.commons.page.MainPageView; 
     
    2829 */ 
    2930public class ApplyPageTemplateHandler extends ElementDropHandler<MainPageView> { 
    3031         
     32        /** 
     33         * Constant created for removing unassigned sub-element. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. 
     36         */ 
     37        public static final String REMOVE_UNASSIGNED_SUBELEMENT = "Remove unassigned subelement"; 
     38         
     39        /** 
     40         * Constant created for applying page template. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. 
     43         */ 
     44        public static final String APPLY_PAGE_TEMPLATE = "Apply page template"; 
    3145        private static ApplyPageTemplateHandler instance = null; 
    3246         
    3347        private ApplyPageTemplateHandler() { 
     
    7488                        TemplateUtil.applyPageTemplate(page, refData.getTemplateRef(), 
    7589                                        existingMap, newElements); 
    7690 
    77                         AutoAction.registerEndChange(page.getAccess(), "Apply page template"); 
     91                        AutoAction.registerEndChange(page.getAccess(), Message.create(APPLY_PAGE_TEMPLATE)); 
    7892 
    7993                        // go to the page that was changed 
    8094                        BookView bookView = getView().getBookView();             
     
    88102                for (ElementH subelement : element.getSubElements()) { 
    89103                        if (!existingMap.containsValue(subelement.getRef())) {                           
    90104                                element.removeSubElement(subelement.getRef().getThisChildRef(), 
    91                                                 "Remove unassigned subelement", false);                          
     105                                                Message.create(REMOVE_UNASSIGNED_SUBELEMENT), false);                            
    92106                        } else { 
    93107                                deleteUnassignedElements(subelement, existingMap); 
    94108                        } 
  • modules/org.sophie2.base.model.resources.r4/src/test/java/org/sophie2/base/model/resources/r4/access/BaseResourceAccessTest.java

     
    99import org.sophie2.base.model.resources.r4.dummies.resources.DummyResource; 
    1010import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    1111import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     12import org.sophie2.base.skins.Message; 
    1213import org.sophie2.core.prolib.impl.AutoProperty; 
    1314import org.sophie2.core.prolib.interfaces.Prop; 
    1415import org.sophie2.core.testing.UnitTestBase; 
     
    2122 */ 
    2223public class BaseResourceAccessTest extends UnitTestBase { 
    2324 
     25        /** 
     26         * Constant created for moving the redirect. 
     27         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     28         * Used for skinning. Used in the test. 
     29         */ 
     30        public static final String MOVE_REDIRECT = "Move the redirect"; 
     31         
     32        /** 
     33         * Constant created for moving the group with a group in another group. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. Used in the test. 
     36         */ 
     37        public static final String MOVE_GROUP_WITH_GROUP_IN_ANOTHER_GROUP = "Move the group with a group in another group."; 
     38         
     39        /** 
     40         * Constant created for moving the group with a frame in another group. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. Used in the test. 
     43         */ 
     44        public static final String MOVE_GROUP_WITH_FRAME_IN_ANOTHER_GROUP = "Move the group with a frame in another group."; 
     45 
     46        /** 
     47         * Constant created for moving the frame in a group. 
     48         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     49         * Used for skinning. Used in the test. 
     50         */ 
     51        public static final String MOVE_FRAME_IN_GROUP = "Move the frame in a group"; 
    2452        private ResourceAccess access; 
    2553        private TestHelper helper; 
    2654         
     
    134162                assertEquals(0, TestHelper.autoCounter); 
    135163                 
    136164                final String one = "1+"; 
    137                 new AutoAction("Changing one", true) { 
     165                new AutoAction(Message.create(CHANGE_ONE), true) { 
    138166                         
    139167                        private final String myField = one; 
    140168                         
     
    155183                 
    156184                 
    157185                final String two = "2"; 
    158                 new AutoAction("Changing two", true) { 
     186                new AutoAction(Message.create(CHANGE_TWO), true) { 
    159187                        @Override 
    160188                        public void performAuto() { 
    161189                                getChanger().setRaw(DummyResource.KEY_DUMMY_COMPOSITE_TWO, two); 
     
    170198                assertEquals(2, TestHelper.autoCounter); // one + two 
    171199                 
    172200                final String dummy = "dummy"; 
    173                 new AutoAction("Changing dummy", true) { 
     201                new AutoAction(Message.create(CHANGE_DUMMY), true) { 
    174202                        @Override 
    175203                        public void performAuto() { 
    176204                                getChanger().setRaw(DummyResource.KEY_SIMPLE_DUMMY, dummy); 
     
    190218                final String FRAME_KIND = "Frame A"; 
    191219                 
    192220                final ResourceRefR4 frameRef = ResourceRefR4.makeChild("Frame A"); 
    193                 new AutoAction("Create a Frame in this book", true) { 
     221                new AutoAction(Message.create(CREATE_FRAME), true) { 
    194222                        @Override 
    195223                        public void performAuto() { 
    196224                        getChanger().makeResource(frameRef); 
     
    199227                }.register(this.access); 
    200228                 
    201229                final ResourceRefR4 groupRef = ResourceRefR4.makeChild("Group A"); 
    202                 new AutoAction("Move the frame in a group", true) { 
     230                new AutoAction(Message.create(MOVE_FRAME_IN_GROUP), true) { 
    203231                        @Override 
    204232                        public void performAuto() { 
    205233                                getChanger().makeResource(groupRef); 
     
    210238                }.register(this.access); 
    211239                 
    212240                final ResourceRefR4 anotherGroupRef = ResourceRefR4.makeChild("Group B"); 
    213                 new AutoAction("Move the group with a frame in another group.", true) { 
     241                new AutoAction(Message.create(MOVE_GROUP_WITH_FRAME_IN_ANOTHER_GROUP), true) { 
    214242                        @Override 
    215243                        public void performAuto() { 
    216244                                getChanger().makeResource(anotherGroupRef); 
     
    221249                }.register(this.access); 
    222250                 
    223251                final ResourceRefR4 thirdGroupRef = ResourceRefR4.makeChild("Group C"); 
    224                 new AutoAction("Move the group with a group in another group.", true) { 
     252                new AutoAction(Message.create(MOVE_GROUP_WITH_GROUP_IN_ANOTHER_GROUP), true) { 
    225253                        @Override 
    226254                        public void performAuto() { 
    227255                                getChanger().makeResource(thirdGroupRef); 
     
    230258                        } 
    231259                }.register(this.access); 
    232260                 
    233                 new AutoAction("Move the redirect", true) { 
     261                new AutoAction(Message.create(MOVE_REDIRECT), true) { 
    234262                        @Override 
    235263                        public void performAuto() { 
    236264                                getChanger().moveResource(frameRef, ResourceRefR4.makeChild("a secret place.")); 
     
    240268                ResourceAccess frame = this.access.open(frameRef, AccessOptions.DEFAULT_ACCESS_OPTIONS); 
    241269                assertEquals(FRAME_KIND, frame.getRaw(ResourceR4.KEY_KIND)); 
    242270        } 
     271         
     272        /** 
     273         * Constant created for changing one. 
     274         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     275         * Used for skinning. Used in the test. 
     276         */ 
     277        public static final String CHANGE_ONE = "Changing one"; 
     278         
     279        /** 
     280         * Constant created for changing two. 
     281         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     282         * Used for skinning. Used in the test. 
     283         */ 
     284        public static final String CHANGE_TWO = "Changing two"; 
     285         
     286        /** 
     287         * Constant created for changing dummy. 
     288         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     289         * Used for skinning. Used in the test. 
     290         */ 
     291        public static final String CHANGE_DUMMY = "Changing dummy"; 
     292         
     293        /** 
     294         * Constant created for creating a frame in this book. 
     295         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     296         * Used for skinning. Used in the test. 
     297         */ 
     298        public static final String CREATE_FRAME = "Create a Frame in this book"; 
    243299} 
     300 No newline at end of file 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/align/AlignElementsLogic.java

     
    1616import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1717import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1818import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.core.mvc.EventFilterBuilder; 
    2021import org.sophie2.core.mvc.OperationDef; 
    2122import org.sophie2.core.mvc.events.EventR3; 
     
    2930 * @author peko, mitex 
    3031 */ 
    3132public enum AlignElementsLogic implements OperationDef { 
    32  
     33         
    3334        /** 
    3435         * Handles a user request to align the selected page elements. Uses the 
    3536         * bounding rectangle of the elements. 
     
    8586                        final ImmList<LocationChannel> immOldLocations = NaiveImmList.create(oldLocations); 
    8687                        final ImmList<TimePos> immTimes = NaiveImmList.create(localTimes); 
    8788 
    88                         new AutoAction("Align elements", true) { 
     89                        new AutoAction(Message.create(ALIGN_ELEMENTS), true) { 
    8990 
    9091                                @Override 
    9192                                public void performAuto() { 
     
    102103 
    103104                        return true; 
    104105                } 
    105         } 
     106        }; 
     107         
     108        /** 
     109         * Constant created for aligning elements. 
     110         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     111         * Used for skinning. 
     112         */ 
     113        public static final String ALIGN_ELEMENTS = "Align elements"; 
    106114} 
  • modules/org.sophie2.main.app.halos/src/main/java/org/sophie2/main/app/halos/common/ChangeColorButton.java

     
    66import org.sophie2.base.halos.HaloButton; 
    77import org.sophie2.base.model.book.interfaces.StyledElement; 
    88import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     9import org.sophie2.base.skins.Message; 
    910import org.sophie2.core.logging.SophieLog; 
    1011import org.sophie2.core.mvc.EventFilterBuilder; 
    1112import org.sophie2.core.mvc.OperationDef; 
     
    4950                                final ImmColor bg = DialogManager.get().showDialog(new ColorDialogInput( 
    5051                                                halo.swingComponent().get(), DIALOG_TITLE, INITIAL_COLOR)); 
    5152                                if(bg!=null) { 
    52                                         new AutoAction("Change frame border color", true) { 
     53                                        new AutoAction(Message.create(CHANGE_FRAME_BORDER_COLOR), true) { 
    5354                                                 
    5455                                                @Override 
    5556                                                public void performAuto() { 
     
    6465                                return true; 
    6566                        } 
    6667                         
    67                 }, 
     68                }; 
     69 
     70                /** 
     71                 * Constant created for changing frame border color. 
     72                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     73                 * Used for skinning. 
     74                 */ 
     75                public static final String CHANGE_FRAME_BORDER_COLOR = "Change frame border color"; 
    6876        } 
    6977} 
  • modules/org.sophie2.main.func.servers/src/test/java/org/sophie2/main/func/servers/resources/ServerResourceLocatorTest.java

     
    1919import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2020import org.sophie2.base.model.security.BaseModelSecurityModule; 
    2121import org.sophie2.base.persistence.BasePersistenceModule; 
     22import org.sophie2.base.skins.Message; 
    2223import org.sophie2.core.logging.LogLevel; 
    2324import org.sophie2.core.logging.SophieLog; 
    2425import org.sophie2.core.modularity.FakeModuleRegistry; 
     
    3738 */ 
    3839public class ServerResourceLocatorTest extends IntegrationTestBase { 
    3940 
     41        /** 
     42         * Constant created for significant test change. 
     43         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     44         * Used for skinning. Used in the test. 
     45         */ 
     46        public static final String SIGNIFACNT_TEST_CHANGE = "signifacnt test change"; 
     47 
    4048        private static final String TEST_SERVER_LOCATION = "/resources/test-book.book.s2"; 
    4149 
    4250        private String testBookLocation = null; 
     
    118126                StoredResourceAccess asteaAccess =  
    119127                        (StoredResourceAccess) this.appLocator.open(target, null); 
    120128                final String titleVale = "signifacantly changed comment."; 
    121                 new AutoAction("signifacnt test change", true) { 
     129                new AutoAction(Message.create(SIGNIFACNT_TEST_CHANGE), true) { 
    122130 
    123131                        @Override 
    124132                        public void performAuto() { 
  • modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/facade/JSFrame.java

     
    1616import org.sophie2.base.model.resources.r4.ResourceRefR4; 
    1717import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1818import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.main.app.commons.element.ElementView; 
    2021import org.sophie2.main.app.commons.frame.FrameView; 
    2122 
     
    2526 * @author mitex 
    2627 */ 
    2728public class JSFrame extends BaseJSAdapter<FrameView> { 
     29         
     30        /** 
     31         * Constant created for expressing that rotation angle of a frame is set using scripting. 
     32         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     33         * Used for skinning. 
     34         */ 
     35        public static final String SCRIPTING_SET_ROTATION_ANGLE_OF_FRAME = "Scripting: Set rotation angle of frame"; 
     36 
     37        /** 
     38         * Constant created for expressing that frame location is set using scripting. 
     39         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     40         * Used for skinning. 
     41         */ 
     42        public static final String SCRIPTING_SET_FRAME_LOCATION = "Scripting: Set frame location"; 
     43 
     44        /** 
     45         * Constant created for expressing that z order of a frame is changed using scripting. 
     46         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     47         * Used for skinning. 
     48         */ 
     49        public static final String CHANGE_FRAME_Z_ORDER = "Change frame zOrder"; 
     50 
     51        /** 
     52         * Constant created for expressing that frame size is set using scripting. 
     53         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     54         * Used for skinning. 
     55         */ 
     56        public static final String SCRIPTING_SET_FRAME_SIZE = "Scripting: Set frame size"; 
    2857 
    2958        private static final long serialVersionUID = 3475060641486028780L; 
    3059 
     
    71100                final ImmSize newSize = BoundMode.OUT_BORDER.setSize(size, frame.getPaddingInsets(),  
    72101                                frame.getStyleHelper().getBorderInsets(), frame.getMarginInsets()); 
    73102 
    74                 new AutoAction("Scripting: Set frame size", false) { 
     103                new AutoAction(Message.create(SCRIPTING_SET_FRAME_SIZE), false) { 
    75104                         
    76105                        @Override 
    77106                        public void performAuto() { 
     
    129158                final ImmList<ActivationChannel> newChannels =  
    130159                        channels.remove(index).add(newIndex, channel); 
    131160                 
    132                 new AutoAction("Change frame zOrder", false) { 
     161                new AutoAction(Message.create(CHANGE_FRAME_Z_ORDER), false) { 
    133162 
    134163                        @Override 
    135164                        public void performAuto() { 
     
    182211                final LocationChannel channel = frame.get(MemberElement.KEY_LOCATION); 
    183212                final TimePos time = getAdaptedObject().getTime(); 
    184213                 
    185                 new AutoAction("Scripting: Set frame location", false) { 
     214                new AutoAction(Message.create(SCRIPTING_SET_FRAME_LOCATION), false) { 
    186215 
    187216                        @Override 
    188217                        public void performAuto() { 
     
    214243        public void jsSet_rotatingAngle(double angle) { 
    215244                 
    216245                final Double angleRef = new Double(angle * Math.PI / 180); 
    217                 new AutoAction("Scripting: Set rotation angle of frame", false) { 
     246                new AutoAction(Message.create(SCRIPTING_SET_ROTATION_ANGLE_OF_FRAME), false) { 
    218247 
    219248                        @Override 
    220249                        public void performAuto() { 
  • modules/org.sophie2.extra.func.browser/src/main/java/org/sophie2/extra/func/browser/view/BrowserLogic.java

     
    44import org.sophie2.base.commons.util.position.ImmPoint; 
    55import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    66import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     7import org.sophie2.base.skins.Message; 
    78import org.sophie2.base.visual.interaction.InputEventR3; 
    89import org.sophie2.core.mvc.EventFilterBuilder; 
    910import org.sophie2.core.mvc.OperationDef; 
     
    181182                        ResourceAccess access = AppHaloUtil.getSingleSelected(addressBar, 
    182183                                        NativeBrowserFrameView.class).getAccess(); 
    183184 
    184                         new AutoAction("Browser address changed", true) { 
     185                        new AutoAction(Message.create(BROWSER_ADDRESS_CHANGED), true) { 
    185186                                @Override 
    186187                                public void performAuto() { 
    187188                                        getChanger().setRaw(BrowserFrameR4.KEY_URL, value); 
     
    191192                        return true; 
    192193                } 
    193194 
    194         } 
     195        }; 
     196 
     197        /** 
     198         * Constant created for notifying that the browser address changed. 
     199         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     200         * Used for skinning. 
     201         */ 
     202        public static final String BROWSER_ADDRESS_CHANGED = "Browser address changed"; 
    195203} 
  • modules/org.sophie2.extra.func.annotations/src/main/java/org/sophie2/extra/func/annotations/view/halos/StickyMoveHaloButton.java

     
    1313import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1414import org.sophie2.base.scene.SceneVisual; 
    1515import org.sophie2.base.scene.helpers.SceneHelper; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.base.skins.SkinElementId; 
    1718import org.sophie2.base.visual.skins.VisualElementDef; 
    1819import org.sophie2.extra.func.annotations.view.StickyView; 
     
    2829@VisualElementDef(parent = StickyHaloMenu.class, sortKey = "xxx-sticky-move-halo-button") 
    2930public class StickyMoveHaloButton extends PageElementMoveHaloButton { 
    3031 
     32        /** 
     33         * Constant created for notifying that a sticky is moving. 
     34         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     35         * Used for skinning. 
     36         */ 
     37        public static final String STICKY_IS_MOVING = "Sticky is moving..."; 
     38         
     39        /** 
     40         * Constant created for notifying that a sticky is moved. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. 
     43         */ 
     44        public static final String STICKY_MOVED = "Sticky moved."; 
     45 
    3146        @Override 
    3247        protected MouseCapture captureClick(MouseEvent e) { 
    3348 
     
    5368                                final ImmPoint newlocation =  
    5469                                        MemberElement.KEY_LOCATION.get(access).getValue(time); 
    5570 
    56                                 new AutoAction("Sticky moved.", true) { 
     71                                new AutoAction(Message.create(STICKY_MOVED), true) { 
    5772 
    5873                                        @Override 
    5974                                        public void performAuto() { 
     
    6984                                ImmSize offset = sceneToParent.transform(new ImmPoint(newX, newY)).minus(zero);  
    7085                                final ImmPoint newLocation = oldLocation.plus(offset);  
    7186 
    72                                 new AutoAction("Sticky is moving...", false) { 
     87                                new AutoAction(Message.create(STICKY_IS_MOVING), false) { 
    7388 
    7489                                        @Override 
    7590                                        public void performAuto() { 
  • modules/org.sophie2.main.app.commons/src/test/java/org/sophie2/main/app/commons/dialogs/BookPropertiesDialogDemo.java

     
    2323import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    2424import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2525import org.sophie2.base.skins.BaseSkinsModule; 
     26import org.sophie2.base.skins.Message; 
    2627import org.sophie2.base.visual.BaseVisualModule; 
    2728import org.sophie2.core.modularity.SophieModule; 
    2829import org.sophie2.core.mvc.CoreMvcModule; 
     
    3536 */ 
    3637public class BookPropertiesDialogDemo extends ModelTestBase { 
    3738 
     39        /** 
     40         * Constant created for creating a book with two pages. 
     41         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     42         * Used for skinning. 
     43         */ 
     44        public static final String CREATE_BOOK_TWO_PAGES = "Create a book with two pages"; 
     45 
    3846        @SuppressWarnings("unchecked") 
    3947        @Override 
    4048        protected List<Class<? extends SophieModule>> fillDependencies() { 
     
    4654 
    4755                ResourceAccess access = makeBookAccess(); 
    4856 
    49                 new AutoAction("Create a book with two pages", true) { 
     57                new AutoAction(Message.create(CREATE_BOOK_TWO_PAGES), true) { 
    5058                        @Override 
    5159                        public void performAuto() { 
    5260                                getChanger().setRaw(ResourceR4.KEY_KIND, BookR4.KIND); 
  • modules/org.sophie2.main.func.timelines/src/main/java/org/sophie2/main/func/timelines/hud/HeadSection.java

     
    1616import org.sophie2.base.model.book.timelines.TimelineOptions; 
    1717import org.sophie2.base.model.resources.r4.access.ResourceAccess; 
    1818import org.sophie2.base.model.resources.r4.changes.AutoAction; 
     19import org.sophie2.base.skins.Message; 
    1920import org.sophie2.base.skins.SkinElementId; 
    2021import org.sophie2.base.visual.BaseSwingVisualElement; 
    2122import org.sophie2.base.visual.skins.ElementSkinPart; 
     
    392393                        } 
    393394 
    394395                        @Override 
    395                         public String getActionLabel() { 
    396                                 return "Set intro length"; 
     396                        public Message getActionLabel() { 
     397                                return Message.create(SET_INTRO_LENGTH); 
    397398                        } 
    398399 
    399400                }, 
     
    416417                        } 
    417418 
    418419                        @Override 
    419                         public String getActionLabel() { 
    420                                 return "Set main length"; 
     420                        public Message getActionLabel() { 
     421                                return Message.create(SET_MAIN_LENGTH); 
    421422                        } 
    422423 
    423424                }, 
     
    434435                        } 
    435436 
    436437                        @Override 
    437                         public String getActionLabel() { 
    438                                 return "Set outro length"; 
     438                        public Message getActionLabel() { 
     439                                return Message.create(SET_OUTRO_LENGTH); 
    439440                        } 
    440441 
    441442                        @Override 
     
    445446                        } 
    446447                }; 
    447448 
     449                /** 
     450                 * Constant created for setting intro length. 
     451                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     452                 * Used for skinning. 
     453                 */ 
     454                public static final String SET_INTRO_LENGTH = "Set intro length"; 
     455                 
     456                /** 
     457                 * Constant created for setting main length. 
     458                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     459                 * Used for skinning. 
     460                 */ 
     461                public static final String SET_MAIN_LENGTH = "Set main length"; 
     462                 
     463                /** 
     464                 * Constant created for setting outro length. 
     465                 * Constant created to be a parameter of a message of an {@link AutoAction}.  
     466                 * Used for skinning. 
     467                 */ 
     468                public static final String SET_OUTRO_LENGTH = "Set outro length"; 
     469 
    448470                public boolean handle(EventR3 event) { 
    449471                        BaseTimelinesSpinner spinner = event.getSource(BaseTimelinesSpinner.class); 
    450472 
     
    482504                 *  
    483505                 * @return Description of the action that will be performed 
    484506                 */ 
    485                 protected abstract String getActionLabel(); 
     507                protected abstract Message getActionLabel(); 
    486508 
    487509                /** 
    488510                 * Should create a new instance of {@link TimelineOptions} that will 
  • modules/org.sophie2.extra.func.plain/src/main/java/org/sophie2/extra/func/plain/PlainTextLogic.java

     
    99import org.sophie2.base.menus.MenuItem; 
    1010import org.sophie2.base.model.book.BookH; 
    1111import org.sophie2.base.model.book.PageH; 
     12import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1213import org.sophie2.base.model.text.smart.ImmHotText; 
     14import org.sophie2.base.skins.Message; 
    1315import org.sophie2.core.logging.SophieLog; 
    1416import org.sophie2.core.mvc.EventFilterBuilder; 
    1517import org.sophie2.core.mvc.OperationDef; 
     
    7274                        ImmHotText text = ImmHotText.createPlain(str.toString()); 
    7375                         
    7476                        HeadTextFrameH.createTextFrameAction(book, page, text, txtFile.toURI(), 
    75                                         null, "Insert plain text", true); 
     77                                        null, Message.create(INSERT_PLAIN_TEXT), true); 
    7678                        return true; 
    7779                } 
    7880                         
    7981        }; 
     82 
     83        /** 
     84         * Constant created for notifying that plain text is inserted. 
     85         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     86         * Used for skinning. 
     87         */ 
     88        public static final String INSERT_PLAIN_TEXT = "Insert plain text"; 
    8089} 
  • modules/org.sophie2.server.core/src/test/java/org/sophie2/server/core/persistence/db/DBContextTest.java

     
    2626import org.sophie2.base.model.resources.r4.model.RevisionId; 
    2727import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2828import org.sophie2.base.persistence.BasePersistenceModule; 
     29import org.sophie2.base.skins.Message; 
    2930import org.sophie2.core.modularity.FakeModuleRegistry; 
    3031import org.sophie2.server.core.persistence.db.params.DBKeyChange; 
    3132import org.sophie2.server.core.persistence.db.params.DBResource; 
     
    465466        } 
    466467 
    467468        private Class<?> getTestChangeClass() { 
    468                 AutoAction action = new AutoAction(TEST_DESC, true) { 
     469                AutoAction action = new AutoAction(Message.create(TEST_DESC), true) { 
    469470 
    470471                        @Override 
    471472                        public void performAuto() { 
  • modules/org.sophie2.base.model.book/pom.xml

     
    6161                        <groupId>org.sophie2</groupId> 
    6262                        <artifactId>org.sophie2.base.skins</artifactId> 
    6363                        <version>2.0.5</version> 
    64                         <scope>test</scope> 
    6564                </dependency> 
    6665                <dependency> 
    6766                        <groupId>junit</groupId> 
  • modules/org.sophie2.extra.comment/src/test/java/org/sophie2/extra/comment/CommentTestUtil.java

     
    1919import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    2020import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
    2121import org.sophie2.base.model.text.smart.ImmHotText; 
     22import org.sophie2.base.skins.Message; 
    2223import org.sophie2.extra.comment.model.Comment; 
    2324import org.sophie2.extra.comment.model.CommentStream; 
    2425import org.sophie2.extra.comment.model.CommentStreamH; 
     
    3031 */ 
    3132public class CommentTestUtil { 
    3233         
     34        public static final String CREATE_FRAME1 = "Create Frame1"; 
     35 
     36        public static final String CREATE_A_BOOK_WITH_TWO_PAGES = "Create a book with two pages"; 
     37 
     38        public static final String CREATE_A_COMMENT_STREAM_WITH_2_COMMENTS = "Create a comment stream with 2 comments."; 
     39 
    3340        /** 
    3441         * Sample content of the first {@link Comment} in the stream. 
    3542         */ 
     
    6673 
    6774                final ResourceRefR4 streamRef = ResourceRefR4.generateRandomSub("Stream"); 
    6875                 
    69                 new AutoAction("Create a comment stream with 2 comments.", true) { 
     76                new AutoAction(Message.create(CREATE_A_COMMENT_STREAM_WITH_2_COMMENTS), true) { 
    7077                         
    7178                        @Override 
    7279                        public void performAuto() { 
     
    105112                ResourceRevision head = LocalResourceRevision.getInitialRevision(); 
    106113                ResourceAccess access = locator.create(ref, AccessOptions.DEFAULT_ACCESS_OPTIONS, head); 
    107114 
    108                 new AutoAction("Create a book with two pages", true) { 
     115                new AutoAction(Message.create(CREATE_A_BOOK_WITH_TWO_PAGES), true) { 
    109116                        @Override 
    110117                        public void performAuto() { 
    111118                                getChanger().setRaw(ResourceR4.KEY_KIND, BookR4.KIND); 
     
    124131                        } 
    125132                }.register(access); 
    126133                 
    127                 new AutoAction("Create Frame1", true) { 
     134                new AutoAction(Message.create(CREATE_FRAME1), true) { 
    128135                        @Override 
    129136                        public void performAuto() { 
    130137                                ResourceRefR4 subRef = ResourceRefR4.make("./PAGE_A/FRAME_1"); 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/changes/ChangePersister.java

     
    1212import org.sophie2.base.persistence.persister.RefToStoragePersister; 
    1313import org.sophie2.base.persistence.ref.ValueRef; 
    1414import org.sophie2.base.persistence.storage.Storage; 
     15import org.sophie2.base.skins.Message; 
    1516import org.sophie2.core.prolib.annot.Immutable; 
    1617 
    1718/** 
     
    111112                                        PersistenceUtil.getStorageR3Schema(Immutable.class)); 
    112113                        if (options.isLoadMode()) { 
    113114                                        source.set(new ModelChange(scopeRef.get(), userRef.get(), viewIdRef.get(),  
    114                                                         descriptionRef.get(), isSignificantRef.get(), autoActionClassRef.get(),  
     115                                                        Message.create(descriptionRef.get()), isSignificantRef.get(), autoActionClassRef.get(),  
    115116                                                        actionFieldsRef.get())); 
    116117                        } 
    117118                } else if (metaChange) { 
     
    129130                        MasterPersister.persist(skipedRevisionIdRef, target.child("skipped-revision-id"), options,  
    130131                                        PersistenceUtil.getStorageR3Schema(Immutable.class)); 
    131132                        if (options.isLoadMode()) { 
    132                                 source.set(new MetaChange(userRef.get(), viewIdRef.get(), descriptionRef.get(),  
     133                                source.set(new MetaChange(userRef.get(), viewIdRef.get(), Message.create(descriptionRef.get()),  
    133134                                                metaChangeTypeRef.get(), skipedRevisionIdRef.get())); 
    134135                        } 
    135136                         
  • modules/org.sophie2.extra.func.scripting/src/main/java/org/sophie2/extra/func/scripting/facade/JSBook.java

     
    1313import org.sophie2.base.model.resources.r4.ResourceUtil; 
    1414import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    1515import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     16import org.sophie2.base.skins.Message; 
    1617import org.sophie2.main.app.commons.book.BookView; 
    1718import org.sophie2.main.app.commons.page.RootPageView; 
    1819 
     
    2324 */ 
    2425public class JSBook extends BaseJSAdapter<BookView> { 
    2526 
     27        /** 
     28         * Constant created for expressing that page is moved using scripting. 
     29         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     30         * Used for skinning. 
     31         */ 
     32        public static final String SCRIPTING_MOVE_PAGE = "Scripting: Move page"; 
     33 
     34        /** 
     35         * Constant created for expressing that page is removed using scripting. 
     36         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     37         * Used for skinning. 
     38         */ 
     39        public static final String SCRIPTING_REMOVE_PAGE = "Scripting: Remove page"; 
     40 
     41        /** 
     42         * Constant created for expressing that new page is added using scripting. 
     43         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     44         * Used for skinning. 
     45         */ 
     46        public static final String SCRIPTING_ADD_NEW_PAGE = "Scripting: Add new page"; 
     47 
     48        /** 
     49         * Constant created for expressing that page size is set using scripting. 
     50         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     51         * Used for skinning. 
     52         */ 
     53        public static final String SCRIPTING_SET_PAGE_SIZE = "Scripting: Set page size"; 
     54 
     55        /** 
     56         * Constant created for expressing that book title is set using scripting. 
     57         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     58         * Used for skinning. 
     59         */ 
     60        public static final String SCRIPTING_SET_BOOK_TITLE = "Scripting: Set book title"; 
     61 
    2662        private static final long serialVersionUID = -3264517072898693605L; 
    2763 
    2864        /** 
     
    5490        public void jsSet_title(final String title) { 
    5591                BookH book = getAdaptedObject().model().get(); 
    5692                 
    57                 new AutoAction("Scripting: Set book title", false) { 
     93                new AutoAction(Message.create(SCRIPTING_SET_BOOK_TITLE), false) { 
    5894                         
    5995                        @Override 
    6096                        public void performAuto() { 
     
    83119                final ImmSize size = (ImmSize) value.unwrap(); 
    84120                BookH book = getAdaptedObject().model().get(); 
    85121                 
    86                 new AutoAction("Scripting: Set page size", false) { 
     122                new AutoAction(Message.create(SCRIPTING_SET_PAGE_SIZE), false) { 
    87123                         
    88124                        @Override 
    89125                        public void performAuto() { 
     
    126162                 
    127163                final String pageName =  
    128164                        ResourceUtil.getNextTitle(book.getRef(), PageR4.DEFAULT_TITLE); 
    129                 new AutoAction("Scripting: Add new page", false) { 
     165                new AutoAction(Message.create(SCRIPTING_ADD_NEW_PAGE), false) { 
    130166                         
    131167                        @Override 
    132168                        public void performAuto() { 
     
    153189                final ResourceRefR4 pageRef = book.getPages().get(index); 
    154190                final ResourceRefList pages = book.get(BookR4.KEY_PAGES); 
    155191                 
    156                 new AutoAction("Scripting: Remove page" , false) { 
     192                new AutoAction(Message.create(SCRIPTING_REMOVE_PAGE), false) { 
    157193                         
    158194                        @Override 
    159195                        public void performAuto() { 
     
    175211                BookH book = getAdaptedObject().model().get(); 
    176212                final ResourceRefList children = book.getPages(); 
    177213 
    178                 new AutoAction("Scripting: Move page", false) { 
     214                new AutoAction(Message.create(SCRIPTING_MOVE_PAGE), false) { 
    179215 
    180216                        @Override 
    181217                        public void performAuto() { 
  • modules/org.sophie2.base.model.resources.r4/src/main/java/org/sophie2/base/model/resources/r4/resources/ResourceH.java

     
    1818import org.sophie2.base.model.resources.r4.keys.Key; 
    1919import org.sophie2.base.model.resources.r4.keys.TemplatedKey; 
    2020import org.sophie2.base.model.resources.r4.model.ResourceReferrer; 
     21import org.sophie2.base.skins.Message; 
    2122import org.sophie2.core.prolib.errors.NotAvailableException; 
    2223import org.sophie2.core.prolib.impl.BaseProObject; 
    2324import org.sophie2.core.prolib.interfaces.Prop; 
     
    410411         *                      The new title of the resource. 
    411412         */ 
    412413        public static void changeTitle(ResourceH resource, final String newTitle) { 
    413                 new AutoAction("Change resource title to " + newTitle, true) { 
     414                new AutoAction(Message.create(RES_TITLE, newTitle), true) { 
    414415 
    415416                        @Override 
    416417                        public void performAuto() { 
     
    421422        } 
    422423         
    423424        /** 
     425         * Constant created for changing resource title. 
     426         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     427         * Used for skinning. 
     428         */ 
     429        public static final String RES_TITLE = "Change resource title to %1$s"; 
     430         
     431        /** 
    424432         * Gets the file extension for the export of this resource. Different helpers  
    425433         * could override this method to give more specific extensions.  
    426434         *   
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/testing/ModelTestBase.java

     
    2929import org.sophie2.base.model.resources.r4.model.ResourceModel; 
    3030import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    3131import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     32import org.sophie2.base.skins.Message; 
    3233import org.sophie2.core.modularity.FakeModuleRegistry; 
    3334import org.sophie2.core.modularity.SophieModule; 
    3435import org.sophie2.core.testing.IntegrationTestBase; 
     
    4243@NoTest 
    4344public class ModelTestBase extends IntegrationTestBase { 
    4445 
     46        /** 
     47         * Constant created for creating test frame. 
     48         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     49         * Used for skinning. Used in the test. 
     50         */ 
     51        public static final String CREATE_TEST_FRAME = "Create test frame."; 
     52         
     53        /** 
     54         * Constant created for creating test page. 
     55         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     56         * Used for skinning. Used in the test. 
     57         */ 
     58        public static final String CREATE_TEST_PAGE = "Create test page."; 
    4559        private AppLocator appLocator; 
    4660         
    4761         
     
    114128                book.getAccess().getHead().getModel().debugPrint(); 
    115129                final ResourceRefList pages = book.get(BookR4.KEY_PAGES); 
    116130                 
    117                 new AutoAction("Create test page.", true) { 
     131                new AutoAction(Message.create(CREATE_TEST_PAGE), true) { 
    118132                        @Override 
    119133                        public void performAuto() { 
    120134                                BookH.addNewPage(getChanger(), pageRef, pages, PageR4.DEFAULT_TITLE); 
     
    139153                final ImmList<ActivationChannel> children =  
    140154                        CompositeElement.KEY_SUB_ELEMENTS.get(page.getAccess()); 
    141155 
    142                 new AutoAction("Create test frame.", true) { 
     156                new AutoAction(Message.create(CREATE_TEST_FRAME), true) { 
    143157                        @Override 
    144158                        public void performAuto() { 
    145159                                FrameH.create(getChanger(), frameRef, FrameR4.DEFAULT_TITLE,  
  • modules/org.sophie2.base.model.book/src/main/java/org/sophie2/base/model/book/BookH.java

     
    2828import org.sophie2.base.model.resources.r4.model.ResourceRevision; 
    2929import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3030import org.sophie2.base.model.resources.r4.resources.ResourceR4; 
     31import org.sophie2.base.skins.Message; 
    3132 
    3233/** 
    3334 * A class representing a book. 
     
    3738public final class BookH extends ResourceH { 
    3839 
    3940        /** 
     41         * Constant created for creating a blank page. 
     42         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     43         * Used for skinning. 
     44         */ 
     45        public static final String CREATE_BLANK_PAGE = "Create blank page."; 
     46 
     47        /** 
    4048         * The prefix of the titles in the books that are in preview mode. 
    4149         */ 
    4250        public static final String PREVIEW_TITLE_PREFIX = "Preview of ";         
     
    447455         */ 
    448456        public static AutoAction createInitAction(final ResourceRefR4 pageRef,  
    449457                        final String pageTitle) { 
    450                 return new AutoAction("Create blank page.", true) { 
     458                return new AutoAction(Message.create(CREATE_BLANK_PAGE), true) { 
    451459                        @Override 
    452460                        public void performAuto() { 
    453461                                BookH.addNewPage(getChanger(), pageRef, BookR4.KEY_PAGES 
  • modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book/GroupTest.java

     
    1919import org.sophie2.base.model.resources.r4.changes.AutoAction; 
    2020import org.sophie2.base.model.resources.r4.changes.ResourceChanger; 
    2121import org.sophie2.base.model.resources.r4.resources.ResourceH; 
     22import org.sophie2.base.skins.Message; 
    2223 
    2324/** 
    2425 * Test for the {@link ElementGroupH} class. 
     
    2728 */ 
    2829public class GroupTest extends ModelTestBase { 
    2930 
     31        /** 
     32         * Constant created for deleting group1 from the page. 
     33         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     34         * Used for skinning. Used in the test. 
     35         */ 
     36        public static final String DELETE_GROUP1_FROM_THE_PAGE = "Delete group1 from the page."; 
     37         
     38        /** 
     39         * Constant created for deleting group2 from page. 
     40         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     41         * Used for skinning. Used in the test. 
     42         */ 
     43        public static final String DELETE_GROUP2_FROM_PAGE = "Delete group2 from page."; 
     44         
     45        /** 
     46         * Constant created for deleting group2 from page. 
     47         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     48         * Used for skinning. Used in the test. 
     49         */ 
     50        public static final String CREATE_GROUP_WITH_GROUP1_AND_FRAME2 = "Create a group with group1 and frame2."; 
     51         
     52        /** 
     53         * Constant created for deleting group2 from page. 
     54         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     55         * Used for skinning. Used in the test. 
     56         */ 
     57        public static final String CREATE_GROUP_WITH_GROUP1_AND_FRAME3 = "Create a group with group1 and frame3."; 
     58         
     59        /** 
     60         * Constant created for creating a group with group0 and frame2.. 
     61         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     62         * Used for skinning. Used in the test. 
     63         */ 
     64        public static final String CREATE_GROUP_WITH_GROUP0_AND_FRAME2 = "Create a group with group0 and frame2."; 
     65         
     66        /** 
     67         * Constant created for creating a group with frame0 and frame1. 
     68         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     69         * Used for skinning. Used in the test. 
     70         */ 
     71        public static final String CREATE_GROUP_FRAME0_AND_FRAME1 = "Create a group with frame0 and frame1."; 
     72         
     73        /** 
     74         * Constant created for creating a group with a group. 
     75         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     76         * Used for skinning. Used in the test. 
     77         */ 
     78        public static final String CREATE_GROUP_WITH_GROUP = "Create a group with a group."; 
     79         
     80        /** 
     81         * Constant created for creating a group with two elements. 
     82         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     83         * Used for skinning. Used in the test. 
     84         */ 
     85        public static final String CREATE_GROUP_TWO_ELEMENTS = "Create a group with two elements."; 
     86         
     87        /** 
     88         * Constant created for creating a bad group with one element. 
     89         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     90         * Used for skinning. Used in the test. 
     91         */ 
     92        public static final String CREATE_GROUP_ONE_ELEMENT = "Create a bad group with one element."; 
     93         
     94        /** 
     95         * Constant created for creating a bad group with zero elements. 
     96         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     97         * Used for skinning. Used in the test. 
     98         */ 
     99        public static final String CREATE_GROUP_ZERO_ELEMENTS = "Create a bad group with zero elements."; 
    30100        private ResourceAccess bookAccess; 
    31101        private PageH page; 
    32102        private FrameH frame0; 
     
    70140                        final ImmList<ActivationChannel> channels =  
    71141                                CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    72142                         
    73                         new AutoAction("Create a bad group with zero elements.", true) { 
     143                        new AutoAction(Message.create(CREATE_GROUP_ZERO_ELEMENTS), true) { 
    74144                                @Override 
    75145                                public void performAuto() { 
    76146                                        ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(), 
     
    94164                        final ImmList<ActivationChannel> channels =  
    95165                                CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    96166                         
    97                         new AutoAction("Create a bad group with one element.", true) { 
     167                        new AutoAction(Message.create(CREATE_GROUP_ONE_ELEMENT), true) { 
    98168                                @Override 
    99169                                public void performAuto() { 
    100170                                        ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(), 
     
    118188                final ImmList<ActivationChannel> channels =  
    119189                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    120190                 
    121                 new AutoAction("Create a group with two elements.", true) { 
     191                new AutoAction(Message.create(CREATE_GROUP_TWO_ELEMENTS), true) { 
    122192                        @Override 
    123193                        public void performAuto() { 
    124194                                ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(),  
     
    148218                final ImmList<ActivationChannel> channels2 =  
    149219                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    150220                 
    151                 new AutoAction("Create a group with a group.", true) { 
     221                new AutoAction(Message.create(CREATE_GROUP_WITH_GROUP), true) { 
    152222                        @Override 
    153223                        public void performAuto() { 
    154224                                ElementGroupH.createGroup(getChanger(), group2Ref, group2Ref.getName(), 
     
    187257                final ImmList<ActivationChannel> channels =  
    188258                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    189259                 
    190                 new AutoAction("Create a group with frame0 and frame1.", true) { 
     260                new AutoAction(Message.create(CREATE_GROUP_FRAME0_AND_FRAME1), true) { 
    191261                        @Override 
    192262                        public void performAuto() { 
    193263                                ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(), 
     
    215285                final ImmList<ActivationChannel> channels2 =  
    216286                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    217287                 
    218                 new AutoAction("Create a group with group0 and frame2.", true) { 
     288                new AutoAction(Message.create(CREATE_GROUP_WITH_GROUP0_AND_FRAME2), true) { 
    219289                        @Override 
    220290                        public void performAuto() { 
    221291                                ElementGroupH.createGroup(getChanger(), group1Ref, group1Ref.getName(),  
     
    240310                final ImmList<ActivationChannel> channels3 =  
    241311                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    242312                 
    243                 new AutoAction("Create a group with group1 and frame3.", true) { 
     313                new AutoAction(Message.create(CREATE_GROUP_WITH_GROUP1_AND_FRAME3), true) { 
    244314                        @Override 
    245315                        public void performAuto() { 
    246316                                ElementGroupH.createGroup(getChanger(), group2Ref, group2Ref.getName(), 
     
    295365                final ImmList<ActivationChannel> channels =  
    296366                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    297367                 
    298                 new AutoAction("Create a group with frame0 and frame1.", true) { 
     368                new AutoAction(Message.create(CREATE_GROUP_FRAME0_AND_FRAME1), true) { 
    299369                        @Override 
    300370                        public void performAuto() { 
    301371                                ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(),  
     
    314384                final ImmList<ActivationChannel> channels2 =  
    315385                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    316386                 
    317                 new AutoAction("Create a group with group1 and frame2.", true) { 
     387                new AutoAction(Message.create(CREATE_GROUP_WITH_GROUP1_AND_FRAME2), true) { 
    318388                        @Override 
    319389                        public void performAuto() { 
    320390                                ElementGroupH.createGroup(getChanger(), group2Ref, group2Ref.getName(), 
     
    329399                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    330400                // Now, we delete a group which contains another group -  
    331401                // the inner one should not be destroyed. 
    332                 new AutoAction("Delete group2 from page.", true) { 
     402                new AutoAction(Message.create(DELETE_GROUP2_FROM_PAGE), true) { 
    333403                        @Override 
    334404                        public void performAuto() { 
    335405                                ElementGroupH.deleteGroup(getChanger(), group2Ref, parentChannels); 
     
    347417                final ImmList<ActivationChannel> parentChannels2 =  
    348418                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    349419                         
    350                         new AutoAction("Delete group1 from the page.", true) { 
     420                        new AutoAction(Message.create(DELETE_GROUP1_FROM_THE_PAGE), true) { 
    351421                                @Override 
    352422                                public void performAuto() { 
    353423                                        ElementGroupH.deleteGroup(getChanger(), ref, parentChannels2); 
     
    379449                final ImmList<ActivationChannel> channels =  
    380450                        CompositeElement.KEY_SUB_ELEMENTS.get(this.page.getAccess()); 
    381451                 
    382                 new AutoAction("Create a group with two elements.", true) { 
     452                new AutoAction(Message.create(CREATE_GROUP_TWO_ELEMENTS), true) { 
    383453                        @Override 
    384454                        public void performAuto() { 
    385455                                ElementGroupH.createGroup(getChanger(), groupRef, groupRef.getName(), 
  • modules/org.sophie2.server.core/src/main/java/org/sophie2/server/core/facade/ServerFacade.java

     
    3030import org.sophie2.base.model.resources.r4.keys.Key; 
    3131import org.sophie2.base.model.resources.r4.model.RevisionId; 
    3232import org.sophie2.base.model.security.UserR4; 
     33import org.sophie2.base.skins.Message; 
    3334import org.sophie2.core.logging.SophieLog; 
    3435import org.sophie2.core.modularity.SophieExtension; 
    3536import org.sophie2.core.prolib.interfaces.ListProp; 
     
    290291                        } 
    291292                } 
    292293                return new MetaChange(change.getUser(), change.getViewId(), 
    293                                 change.getDescription(), change.getType(), 
     294                                Message.create(change.getDescription()), change.getType(), 
    294295                                NaiveImmList.<RevisionId>create(result)); 
    295296        } 
    296297 
  • modules/org.sophie2.dev/src/test/java/org/sophie2/dev/author/BookDocViewDemo.java

     
    3636import org.sophie2.base.model.resources.r4.resources.ResourceH; 
    3737import org.sophie2.base.scene.BaseSceneModule; 
    3838import org.sophie2.base.skins.BaseSkinsModule; 
     39import org.sophie2.base.skins.Message; 
    3940import org.sophie2.base.visual.BaseVisualElement; 
    4041import org.sophie2.base.visual.BaseVisualModule; 
    4142import org.sophie2.core.logging.LogLevel; 
     
    6061 */ 
    6162public class BookDocViewDemo extends AppTestBase { 
    6263         
     64        /** 
     65         * Constant created for creation of an image frame. 
     66         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     67         * Used for skinning. Used in the test. 
     68         */ 
     69        public static final String CREATE_IMAGE_FRAME = "Create test image frame."; 
     70 
     71        /** 
     72         * Constant created for creation of a frame. 
     73         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     74         * Used for skinning. Used in the test. 
     75         */ 
     76        public static final String CREATE_FRAME = "Create test frame."; 
     77 
     78        /** 
     79         * Constant created for changing of frame border. 
     80         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     81         * Used for skinning. Used in the test. 
     82         */ 
     83        public static final String FRAME_BORDER = "Changing frame border"; 
     84 
     85        /** 
     86         * Constant created for changing of page border. 
     87         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     88         * Used for skinning. Used in the test. 
     89         */ 
     90        public static final String PAGE_BORDER = "Changing page border"; 
     91 
     92        /** 
     93         * Constant created for changing of content location. 
     94         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     95         * Used for skinning. Used in the test. 
     96         */ 
     97        public static final String CONTENT_LOCATION = "Changing content location"; 
     98 
     99        /** 
     100         * Constant created for changing background to green. 
     101         * Constant created to be a parameter of a message of an {@link AutoAction}.  
     102         * Used for skinning. Used in the test. 
     103         */ 
     104        public static final String BG_TO_GREEN = "Background to green"; 
     105 
    63106        private static class DummyBookDocView extends BookDocView { 
    64107 
    65108                public DummyBookDocView(ResourceAccess access) { 
     
    157200                this.page = makePage(this.bookAccess); 
    158201                final ResourceRefR4 pageRef = ResourceRefR4.make("./" + this.page.getName()); 
    159202                 
    160                 new AutoAction("Background to green", true) { 
     203                new AutoAction(Message.create(BG_TO_GREEN), true) { 
    161204                        @Override 
    162205                        public void performAuto() { 
    163206                                ResourceChanger pageChanger = getChanger().getSub(pageRef); 
     
    170213                this.frame = makeEmptyFrame(this.page.getAccess()); 
    171214                final ResourceRefR4 frameRef = this.page.getChildRef(this.frame); 
    172215                 
    173                 new AutoAction("Changing content location", true) { 
     216                new AutoAction(Message.create(CONTENT_LOCATION), true) { 
    174217                        @Override 
    175218                        public void performAuto() { 
    176219                                ResourceChanger frameChanger = getChanger().getSub(pageRef).getSub(frameRef); 
     
    219262                        SwingUtilities.invokeAndWait(new Runnable() { 
    220263                                 
    221264                                public void run() { 
    222                                         new AutoAction("Changing page border", true) { 
     265                                        new AutoAction(Message.create(PAGE_BORDER), true) { 
    223266 
    224267                                                @Override 
    225268                                                public void performAuto() { 
     
    237280                        SwingUtilities.invokeAndWait(new Runnable() { 
    238281                                 
    239282                                public void run() { 
    240                                         new AutoAction("Changing frame border", true) { 
     283                                        new AutoAction(Message.create(FRAME_BORDER), true) { 
    241284 
    242285                                                @Override 
    243286                                                public void performAuto() { 
     
    265308                final ImmList<ActivationChannel> children =  
    266309                        CompositeElement.KEY_SUB_ELEMENTS.get(pageAccess); 
    267310 
    268                 new AutoAction("Create test frame.", true) { 
     311                new AutoAction(Message.create(CREATE_FRAME), true) { 
    269312                        @Override 
    270313                        public void performAuto() { 
    271314                                FrameH.create(getChanger(), frameRef, FrameR4.DEFAULT_TITLE, 
     
    293336                final ImmImage image = new ImmImage(imgFile, false); 
    294337                final String imageName = imgFile.getName(); 
    295338                 
    296                 new AutoAction("Create test image frame.", true) { 
     339                new AutoAction(Message.create(CREATE_IMAGE_FRAME), true) { 
    297340                        @Override 
    298341                        public void performAuto() {                              
    299342                                ImageResourceH.create(getChanger(), imageRef, image, imageName);