~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/gui/undo/DeleteQueriesCommand.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package dk.aau.cs.gui.undo;
 
2
 
 
3
import java.util.Collection;
 
4
 
 
5
import pipe.dataLayer.TAPNQuery;
 
6
 
 
7
import dk.aau.cs.gui.TabContent;
 
8
 
 
9
public class DeleteQueriesCommand extends Command {
 
10
        private final Collection<TAPNQuery> queries;
 
11
        private final TabContent tab;
 
12
        
 
13
        public DeleteQueriesCommand(TabContent tab, Collection<TAPNQuery> queries){
 
14
                this.tab = tab;
 
15
                this.queries = queries;
 
16
        }
 
17
 
 
18
        @Override
 
19
        public void redo() {
 
20
                for(TAPNQuery query : queries){
 
21
                        tab.removeQuery(query);
 
22
                }
 
23
        }
 
24
 
 
25
        @Override
 
26
        public void undo() {
 
27
                for(TAPNQuery query : queries){
 
28
                        tab.addQuery(query);
 
29
                }
 
30
        }
 
31
        
 
32
        
 
33
}