@@ -57,15 +57,15 @@ public String getAliasValueAt(int row) {
5757
5858
5959 public void addAlias () {
60- final AliasEditor macroEditor = new AliasEditor ("Add alias " , "" , "" , new EditValidator () );
61- // if (macroEditor.showAndGet()) {
62- // final String name = macroEditor.getFrom ();
63- // myAliases .add(Alias.of(name , macroEditor.getTo ()));
64- // final int index = indexOfAliasWithName(name);
65- // LOG .assertTrue(index >= 0);
66- // myTableModel.fireTableDataChanged();
67- // setRowSelectionInterval(index, index);
68- // }
60+ final AliasEditor macroEditor = new AliasEditor ("Add Type " , "" , "" );
61+ if (macroEditor .showAndGet ()) {
62+ final String name = macroEditor .getTitle ();
63+ typeAliases .add (new TypeAlias ( macroEditor . getTitle () , macroEditor .getDescription ()));
64+ final int index = indexOfAliasWithName (name );
65+ log .assertTrue (index >= 0 );
66+ myTableModel .fireTableDataChanged ();
67+ setRowSelectionInterval (index , index );
68+ }
6969 }
7070
7171 private boolean isValidRow (int selectedRow ) {
@@ -114,7 +114,7 @@ public void removeSelectedAliases() {
114114
115115
116116 public void commit (GitCommitMessageHelperSettings settings ) {
117- settings .getDateSettings ().setTypeAliases (new ArrayList <>(typeAliases ));
117+ settings .getDateSettings ().setTypeAliases (new LinkedList <>(typeAliases ));
118118 }
119119
120120 public void resetDefaultAliases () {
@@ -147,18 +147,18 @@ public boolean editAlias() {
147147 return false ;
148148 }
149149 final int selectedRow = getSelectedRow ();
150- final TypeAlias alias = typeAliases .get (selectedRow );
151- final AliasEditor editor = new AliasEditor ("Edit Alias " , alias .getTitle (), alias .getDescription (), new EditValidator ());
152- /* if (editor.showAndGet()) {
153- alias.setFrom (editor.getFrom ());
154- alias.setTo (editor.getTo ());
150+ final TypeAlias typeAlias = typeAliases .get (selectedRow );
151+ final AliasEditor editor = new AliasEditor ("Edit Type " , typeAlias .getTitle (), typeAlias .getDescription ());
152+ if (editor .showAndGet ()) {
153+ typeAlias . setTitle (editor .getTitle ());
154+ typeAlias . setDescription (editor .getDescription ());
155155 myTableModel .fireTableDataChanged ();
156- }*/
156+ }
157157 return true ;
158158 }
159159
160160 public boolean isModified (GitCommitMessageHelperSettings settings ) {
161- final ArrayList <TypeAlias > aliases = new ArrayList <>();
161+ final List <TypeAlias > aliases = new LinkedList <>();
162162 obtainAliases (aliases , settings );
163163 return !aliases .equals (typeAliases );
164164 }
0 commit comments