use of com.kyj.fx.voeditor.visual.component.text.JavaTextArea in project Gargoyle by callakrsos.
the class FxUtil method createJavaTextArea.
/**
* @작성자 : KYJ
* @작성일 : 2016. 7. 22.
* @param content
*/
public static JavaTextArea createJavaTextArea(String title, String content, double width, double height) {
JavaTextArea javaTextArea = new JavaTextArea();
javaTextArea.setPrefSize(width, height);
javaTextArea.setContent(content);
return javaTextArea;
}
use of com.kyj.fx.voeditor.visual.component.text.JavaTextArea in project Gargoyle by callakrsos.
the class FxUtil method installDoubleClickPopup.
public static <T> void installDoubleClickPopup(Window owner, POPUP_STYLE style, TableView<T> tbMetadata) {
tbMetadata.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
if (MouseButton.PRIMARY == ev.getButton() && ev.getClickCount() == 2) {
ObservableList<TablePosition> selectedCells = tbMetadata.getSelectionModel().getSelectedCells();
TablePosition tablePosition = selectedCells.get(0);
int column = tablePosition.getColumn();
int row = tablePosition.getRow();
Object valueByConverter = FxTableViewUtil.getValue(tbMetadata, column, row);
String value = "";
if (ValueUtil.isNotEmpty(valueByConverter)) {
value = valueByConverter.toString();
}
final double WIDTH = 500d;
final double HEIGHT = 400d;
JavaTextArea createJavaTextArea = createJavaTextArea(value);
createJavaTextArea.setPrefSize(WIDTH, HEIGHT);
switch(style) {
case POP_OVER:
FxUtil.showPopOver(tbMetadata, createJavaTextArea);
break;
case POPUP:
createSimpleTextAreaAndShow(value, stage -> {
stage.setTitle("Show Values");
stage.setWidth(WIDTH);
stage.setHeight(HEIGHT);
stage.initStyle(StageStyle.UTILITY);
stage.initOwner(owner);
stage.focusedProperty().addListener((oba, o, n) -> {
if (!n)
stage.close();
});
stage.getScene().addEventHandler(KeyEvent.KEY_PRESSED, event -> {
if (KeyCode.ESCAPE == event.getCode()) {
if (!event.isConsumed()) {
stage.close();
}
}
});
});
break;
}
}
});
}
use of com.kyj.fx.voeditor.visual.component.text.JavaTextArea in project Gargoyle by callakrsos.
the class SVNViewer method initialize.
@FXML
public void initialize() {
tvSvnView = new SVNTreeView();
tvSvnView.setOnAction(this::svnTreeViewOnAction);
tvSvnView.setOnKeyPressed(this::svnTreeVoewOnKeyPressed);
tvSvnView.load();
anTreePane.getChildren().set(0, tvSvnView);
AnchorPane.setLeftAnchor(tvSvnView, 0.0);
AnchorPane.setRightAnchor(tvSvnView, 0.0);
AnchorPane.setBottomAnchor(tvSvnView, 0.0);
AnchorPane.setTopAnchor(tvSvnView, 0.0);
colRevision.setCellValueFactory(v -> new SimpleObjectProperty<Long>(v.getValue().getRevision()));
colUser.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getAuthor()));
colComment.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getMessage()));
colDate.setCellValueFactory(v -> new SimpleStringProperty(DateUtil.getDateString(v.getValue().getDate().getTime(), "yyyy-MM-dd")));
javaTextAre = new JavaTextArea();
borSource.setCenter(javaTextAre);
lineHist = new LineChart<>(new CategoryAxis(), new CategoryAxis());
borChart.setCenter(lineHist);
tbRevision.getSelectionModel().setCellSelectionEnabled(true);
tbRevision.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
// FxClipboardUtil.installCopyPasteHandler(tbRevision);
// FxTableViewUtil.
FxUtil.installClipboardKeyEvent(tbRevision);
MenuItem menuDiff = new MenuItem("Diff");
menuDiff.setOnAction(this::menuDiffOnAction);
tbRevision.setContextMenu(new ContextMenu(menuDiff));
tvSvnView.svnGraphPropertyProperty().addListener((oba, oldView, newView) -> {
if (newView != null) {
Tab tabSvnGraph = new Tab("SVN Graph", newView);
if (tabPaneSVN.getTabs().size() <= TAB_INDEX_SVN_GRAPH) {
tabPaneSVN.getTabs().add(tabSvnGraph);
} else {
tabPaneSVN.getTabs().add(TAB_INDEX_SVN_GRAPH, tabSvnGraph);
}
}
});
displayLatestRevision();
}
Aggregations