Gridarta Editor
FindAgain.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
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 License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.textedit.textarea.actions;
21 
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
25 import org.jetbrains.annotations.NotNull;
26 
31 public class FindAgain implements ActionListener {
32 
36  @NotNull
37  private final Find find;
38 
42  @NotNull
43  private final Replace replace;
44 
49 
55  public FindAgain(@NotNull final Find find, @NotNull final Replace replace) {
56  this.find = find;
57  this.replace = replace;
58  }
59 
60  @Override
61  public void actionPerformed(@NotNull final ActionEvent e) {
62  switch (type) {
63  case NONE:
64  break;
65 
66  case FIND:
68  break;
69 
70  case REPLACE:
72  break;
73  }
74  }
75 
80  public void setType(@NotNull final FindType type) {
81  this.type = type;
82  }
83 
84 }
net.sf.gridarta.textedit.textarea.actions.Replace
Action listener for "replace".
Definition: Replace.java:50
net.sf.gridarta.textedit.textarea.actions.Replace.replace
boolean replace(@NotNull final JEditTextArea textArea)
Replace the next occurrence of textToFind with {}.
Definition: Replace.java:91
net.sf.gridarta.textedit.textarea
This package contains the other part of the script editor.
net.sf.gridarta.textedit.textarea.actions.FindAgain.replace
final Replace replace
The Replace instance to invoke Replace#replace(net.sf.gridarta.textedit.textarea.JEditTextArea).
Definition: FindAgain.java:43
net.sf.gridarta
Base package of all Gridarta classes.
net.sf
net.sf.gridarta.textedit.textarea.InputHandler
An input handler converts the user's key strokes into concrete actions.
Definition: InputHandler.java:36
net.sf.gridarta.textedit
net.sf.gridarta.textedit.textarea.actions.FindAgain.type
FindType type
The action to perform.
Definition: FindAgain.java:48
net
net.sf.gridarta.textedit.textarea.actions.FindType.NONE
NONE
No action.
Definition: FindType.java:31
net.sf.gridarta.textedit.textarea.InputHandler.getTextArea
static JEditTextArea getTextArea(final EventObject evt)
Returns the text area that fired the specified event.
Definition: InputHandler.java:144
net.sf.gridarta.textedit.textarea.actions.Find.find
void find(@NotNull final JEditTextArea textArea)
Find the next occurrence of textToFind.
Definition: Find.java:67
net.sf.gridarta.textedit.textarea.actions.FindAgain.setType
void setType(@NotNull final FindType type)
Sets the operation to perform.
Definition: FindAgain.java:80
net.sf.gridarta.textedit.textarea.actions.Find
Action listener for "find".
Definition: Find.java:37
net.sf.gridarta.textedit.textarea.actions.FindAgain
Action listener for "find again".
Definition: FindAgain.java:31
net.sf.gridarta.textedit.textarea.actions.FindAgain.actionPerformed
void actionPerformed(@NotNull final ActionEvent e)
Definition: FindAgain.java:61
net.sf.gridarta.textedit.textarea.actions.FindType
The action to perform.
Definition: FindType.java:26
net.sf.gridarta.textedit.textarea.actions.FindAgain.find
final Find find
The Find instance to invoke Find#find(net.sf.gridarta.textedit.textarea.JEditTextArea).
Definition: FindAgain.java:37
net.sf.gridarta.textedit.textarea.actions.FindAgain.FindAgain
FindAgain(@NotNull final Find find, @NotNull final Replace replace)
Creates a new instance.
Definition: FindAgain.java:55