-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modern Find/Replace] Refactor FindReplaceDialog
The FindReplaceDialog's business-logic is now handled in the FindReplacer. The FindReplacer communicates using a FindReplaceStatus object which is polled by FindReplaceDialog as needed and allows for displaying correct messages in the Interface. This Refactoring is required so that the business-logic can be reused in the new FindReplace overlay, as proposed in issue #1090
- Loading branch information
Maximilian Wittmer
authored and
Maximilian Wittmer
committed
Oct 2, 2023
1 parent
0847f8e
commit 527ed76
Showing
3 changed files
with
1,006 additions
and
789 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
...se.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindAndReplaceMessageStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Vector Informatik GmbH - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.ui.texteditor; | ||
|
||
/** | ||
* Use by FindAndReplace to signal warnings, errors and messages to | ||
* FindAndReplaceDialog and FindAndReplaceOverlay. | ||
* | ||
* @since 3.17 | ||
*/ | ||
class FindAndReplaceMessageStatus { | ||
private boolean error; | ||
private boolean warning; | ||
private String message; | ||
|
||
public void resetStatus() { | ||
error = false; | ||
warning = false; | ||
setMessage(""); //$NON-NLS-1$ | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
public boolean isError() { | ||
return error; | ||
} | ||
|
||
public void setError(boolean error) { | ||
this.error = error; | ||
} | ||
|
||
public void setWarning(boolean warning) { | ||
this.warning = warning; | ||
} | ||
|
||
public boolean isWarning() { | ||
return warning; | ||
} | ||
|
||
@Override | ||
public FindAndReplaceMessageStatus clone() { | ||
FindAndReplaceMessageStatus ret = new FindAndReplaceMessageStatus(); | ||
ret.setMessage(message); | ||
ret.setError(isError()); | ||
ret.setWarning(isWarning()); | ||
return ret; | ||
} | ||
|
||
} |
Oops, something went wrong.