-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
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
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
56 changes: 56 additions & 0 deletions
56
src/main/java/com/zzg/mybatis/generator/view/UIProgressCallback.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,56 @@ | ||
package com.zzg.mybatis.generator.view; | ||
|
||
import javafx.scene.control.TextArea; | ||
import org.mybatis.generator.api.ProgressCallback; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Owen on 6/21/16. | ||
*/ | ||
public class UIProgressCallback implements ProgressCallback { | ||
|
||
private TextArea consoleTextArea; | ||
|
||
private StringBuilder sb; | ||
|
||
public UIProgressCallback(TextArea textArea) { | ||
sb = new StringBuilder(); | ||
this.consoleTextArea = textArea; | ||
} | ||
|
||
@Override | ||
public void introspectionStarted(int totalTasks) { | ||
sb.append("introspection started\n"); | ||
consoleTextArea.setText(sb.toString()); | ||
} | ||
|
||
@Override | ||
public void generationStarted(int totalTasks) { | ||
sb.append("generate started\n"); | ||
consoleTextArea.setText(sb.toString()); | ||
} | ||
|
||
@Override | ||
public void saveStarted(int totalTasks) { | ||
sb.append("save started\n"); | ||
consoleTextArea.setText(sb.toString()); | ||
} | ||
|
||
@Override | ||
public void startTask(String taskName) { | ||
sb.append("start task\n"); | ||
consoleTextArea.setText(sb.toString()); | ||
} | ||
|
||
@Override | ||
public void done() { | ||
sb.append("generation done\n"); | ||
consoleTextArea.setText(sb.toString()); | ||
} | ||
|
||
@Override | ||
public void checkCancel() throws InterruptedException { | ||
} | ||
} |