KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > replacementproxy > ReplacementItem


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.replacementproxy;
21
22 import com.sslexplorer.boot.Util;
23
24 public class ReplacementItem {
25
26   private Replacement replacement;
27   private boolean canMoveUp, canMoveDown;
28   private int index;
29   
30   public ReplacementItem(int index, Replacement replacement) {
31     this.replacement = replacement;
32     this.index = index;
33   }
34   
35   public String JavaDoc getIndexString() {
36     return String.valueOf(index);
37   }
38   
39   public String JavaDoc moveDownIndexString() {
40       return String.valueOf(index+1);
41     }
42
43   public String JavaDoc moveUpIndexString() {
44       return String.valueOf(index-1);
45     }
46
47   public int getIndex() {
48     return index;
49   }
50   
51   public void setIndex(int index) {
52     this.index = index;
53   }
54   
55   public Replacement getReplacement() {
56     return replacement;
57   }
58   
59   public String JavaDoc getMatchPatternText() {
60     return Util.trimToSize(replacement.getMatchPattern(), 27, true);
61   }
62   
63   public String JavaDoc getReplacePatternText() {
64     return Util.trimToSize(replacement.getReplacePattern(), 27, true);
65   }
66   
67   public boolean getCanMoveDown() {
68     return canMoveDown;
69   }
70   
71   public void setCanMoveDown(boolean canMoveDown) {
72     this.canMoveDown = canMoveDown;
73   }
74   
75   public boolean getCanMoveUp() {
76     return canMoveUp;
77   }
78   
79   public void setCanMoveUp(boolean canMoveUp) {
80     this.canMoveUp = canMoveUp;
81   }
82
83 }
84
Popular Tags