use of javafx.scene.control.Tooltip in project jabref by JabRef.
the class ViewModelListCellFactory method call.
@Override
public ListCell<T> call(ListView<T> param) {
return new ListCell<T>() {
@Override
protected void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
T viewModel = getItem();
if (empty || viewModel == null) {
setText(null);
setGraphic(null);
setOnMouseClicked(null);
setTooltip(null);
} else {
if (toText != null) {
setText(toText.call(viewModel));
}
if (toGraphic != null) {
setGraphic(toGraphic.call(viewModel));
}
if (toOnMouseClickedEvent != null) {
setOnMouseClicked(toOnMouseClickedEvent.call(viewModel));
}
if (toStyleClass != null) {
getStyleClass().setAll(toStyleClass.call(viewModel));
}
if (toTooltip != null) {
String tooltipText = toTooltip.call(viewModel);
if (StringUtil.isNotBlank(tooltipText)) {
setTooltip(new Tooltip(tooltipText));
}
}
}
getListView().refresh();
}
};
}
use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.
the class SystemLayoutViewController method loadNewSystemTab.
/**
* 탭에 대해 로드함.
*
* @작성자 : KYJ
* @작성일 : 2015. 11. 4.
* @param tabName
* @param fxmlName
*/
@Override
public void loadNewSystemTab(String tabName, String fxmlName) {
Platform.runLater(() -> {
try {
FXMLLoader loader = FxUtil.createNewFxmlLoader();
loader.setLocation(getClass().getResource(fxmlName));
Parent parent = loader.load();
if (beforeParentLoad != null && beforeParentLoad.filter(parent)) {
beforeParentLoad.beforeLoad(parent);
if (beforeParentLoad.isUnloadParent()) {
return;
}
}
DockTab tab = new DockTab(tabName, parent);
// 툴팁 처리 (클래스위치)
tab.setTooltip(new Tooltip(loader.getController().getClass().getName()));
addTabItem(tab);
tab.getTabPane().getSelectionModel().select(tab);
// 리스너 호출.
onParentloaded.forEach(v -> {
v.onLoad(parent);
});
} catch (IOException e1) {
DialogUtil.showExceptionDailog(e1);
}
});
}
use of javafx.scene.control.Tooltip in project Gargoyle by callakrsos.
the class SystemLayoutViewController method loadNewSystemTab.
/********************************
* 작성일 : 2016. 4. 26. 작성자 : KYJ
*
* 새로운 탭을 로드한다.
*
* @param tableName
* @param parent
********************************/
public void loadNewSystemTab(String tableName, CloseableParent<?> parent) {
Platform.runLater(() -> {
try {
Parent _parent = parent.getParent();
if (beforeParentLoad != null && beforeParentLoad.filter(_parent)) {
beforeParentLoad.beforeLoad(_parent);
if (beforeParentLoad.isUnloadParent()) {
return;
}
}
DockTab tab = new DockTab(tableName, _parent);
// 툴팁 처리 (클래스위치)
tab.setTooltip(new Tooltip(parent.getClass().getName()));
addTabItem(tab);
tabPanWorkspace.getSelectionModel().select(tab);
tab.setOnCloseRequest(ev -> {
try {
LOGGER.debug("closeable parent on close request , tabName : {} ", tableName);
parent.close();
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
});
// 리스너 호출.
onParentloaded.forEach(v -> v.onLoad(parent.getParent()));
// tab.getTabPane().getSelectionModel().select(tab);
// _parent.getScene().getStylesheets().clear();
List<Node> findAllByNodes = FxUtil.findAllByNodes(_parent, n -> n instanceof Button);
findAllByNodes.forEach(btn -> {
btn.getStyleClass().add("button-gargoyle");
});
} catch (Exception e1) {
DialogUtil.showExceptionDailog(e1);
}
});
}
use of javafx.scene.control.Tooltip in project bitsquare by bitsquare.
the class PeerInfoIcon method updatePeerInfoIcon.
private void updatePeerInfoIcon() {
String tag;
if (peerTagMap.containsKey(hostName)) {
tag = peerTagMap.get(hostName);
Tooltip.install(this, new Tooltip(tooltipText + "\nTag: " + tag));
} else {
tag = "";
Tooltip.install(this, new Tooltip(tooltipText));
}
if (!tag.isEmpty())
tagLabel.setText(tag.substring(0, 1));
if (numTrades < 10)
numTradesLabel.setText(String.valueOf(numTrades));
else
numTradesLabel.setText("★");
numTradesPane.setVisible(numTrades > 0);
tagPane.setVisible(!tag.isEmpty());
}
use of javafx.scene.control.Tooltip in project bitsquare by bitsquare.
the class OKPayForm method addCurrenciesGrid.
private void addCurrenciesGrid(boolean isEditable) {
Label label = addLabel(gridPane, ++gridRow, "Supported currencies:", 0);
GridPane.setValignment(label, VPos.TOP);
FlowPane flowPane = new FlowPane();
flowPane.setPadding(new Insets(10, 10, 10, 10));
flowPane.setVgap(10);
flowPane.setHgap(10);
if (isEditable)
flowPane.setId("flow-pane-checkboxes-bg");
else
flowPane.setId("flow-pane-checkboxes-non-editable-bg");
CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e -> {
CheckBox checkBox = new CheckBox(e.getCode());
checkBox.setMouseTransparent(!isEditable);
checkBox.setSelected(okPayAccount.getTradeCurrencies().contains(e));
checkBox.setMinWidth(60);
checkBox.setMaxWidth(checkBox.getMinWidth());
checkBox.setTooltip(new Tooltip(e.getName()));
checkBox.setOnAction(event -> {
if (checkBox.isSelected())
okPayAccount.addCurrency(e);
else
okPayAccount.removeCurrency(e);
updateAllInputsValid();
});
flowPane.getChildren().add(checkBox);
});
GridPane.setRowIndex(flowPane, gridRow);
GridPane.setColumnIndex(flowPane, 1);
gridPane.getChildren().add(flowPane);
}
Aggregations