use of javafx.scene.control.Tooltip in project uPMT by coco35700.
the class TypeTreeViewControllerClass method initialize.
@Override
public void initialize(URL location, ResourceBundle resources) {
nomType.setText(type.getType().getName());
couleurType.setStyle("-fx-color-label-visible: false ;");
setColor();
Image icon = ResourceLoader.loadImage("class.gif");
this.classIcon.setImage(icon);
Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
this.rename.setGraphic(iconRename);
Node iconDelete = new ImageView(ResourceLoader.loadImage("delete.gif"));
this.deleteClass.setGraphic(iconDelete);
Node iconAddProp = new ImageView(ResourceLoader.loadImage("addProperty.gif"));
this.addProperty.setGraphic(iconAddProp);
Tooltip deleteClassTip = new Tooltip("Suppression de la classe");
deleteClass.setTooltip(deleteClassTip);
Tooltip addPropertyTip = new Tooltip("Ajout d'une propriet� a la classe");
addProperty.setTooltip(addPropertyTip);
Tooltip renameTip = new Tooltip("Renommer la classe");
rename.setTooltip(renameTip);
}
use of javafx.scene.control.Tooltip in project uPMT by coco35700.
the class TypeTreeViewControllerRoot method initialize.
@Override
public void initialize(URL location, ResourceBundle resources) {
nomType.setText(type.getType().getName());
/*if(Main.activateBetaDesign)
this.nomType.setTextFill(Color.BLACK);*/
Image icon = ResourceLoader.loadImage("schema.gif");
this.rootIcon.setImage(icon);
Node iconRename = new ImageView(ResourceLoader.loadImage("rename.png"));
this.rename.setGraphic(iconRename);
Node iconAddClass = new ImageView(ResourceLoader.loadImage("addclass.gif"));
this.addClass.setGraphic(iconAddClass);
Node iconAddFold = new ImageView(ResourceLoader.loadImage("newfolder.gif"));
this.addFolder.setGraphic(iconAddFold);
Tooltip renameTip = new Tooltip("Renommer le sch�ma");
rename.setTooltip(renameTip);
Tooltip addClassTip = new Tooltip("Ajouter une Classe � la racine");
addClass.setTooltip(addClassTip);
Tooltip addFolderTip = new Tooltip("Ajouter un Dossier � la racine");
addFolder.setTooltip(addFolderTip);
}
use of javafx.scene.control.Tooltip in project certmgr by hdecarne.
the class StoreController method setupStage.
@Override
protected void setupStage(Stage stage) {
stage.getIcons().addAll(Images.STORE32, Images.STORE16);
stage.setTitle(StoreI18N.formatSTR_STAGE_TITLE());
this.cmdStorePreferences.disableProperty().bind(this.storeProperty.isNull());
this.cmdCopyEntry.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
this.cmdDeleteEntry.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
this.cmdNewCert.disableProperty().bind(this.storeProperty.isNull());
this.cmdRevokeCert.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
this.cmdManageCRL.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
this.cmdExportCert.disableProperty().bind(this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().isNull());
this.cmdImportCerts.disableProperty().bind(this.storeProperty.isNull());
this.cmdStorePreferencesButton.disableProperty().bind(this.storeProperty.isNull());
this.cmdCopyEntryButton.disableProperty().bind(this.cmdCopyEntry.disableProperty());
this.cmdDeleteEntryButton.disableProperty().bind(this.cmdDeleteEntry.disableProperty());
this.cmdNewCertButton.disableProperty().bind(this.cmdNewCert.disableProperty());
this.cmdRevokeCertButton.disableProperty().bind(this.cmdRevokeCert.disableProperty());
this.cmdManageCRLButton.disableProperty().bind(this.cmdManageCRL.disableProperty());
this.cmdExportCertButton.disableProperty().bind(this.cmdExportCert.disableProperty());
this.cmdImportCertsButton.disableProperty().bind(this.cmdImportCerts.disableProperty());
ContextMenu storeEntryViewMenu = this.ctlStoreEntryView.getContextMenu();
this.ctlStoreEntryView.setContextMenu(null);
this.ctlStoreEntryView.setRowFactory(param -> {
ContextMenu menu = storeEntryViewMenu;
return new TreeTableRow<StoreEntryModel>() {
@Override
protected void updateItem(@Nullable StoreEntryModel item, boolean empty) {
super.updateItem(item, empty);
if (!empty) {
setContextMenu(menu);
} else {
setContextMenu(null);
}
}
};
});
Tooltip storeEntryViewTooltip = this.ctlStoreEntryView.getTooltip();
this.ctlStoreEntryTooltipExternalCrt.managedProperty().bind(this.ctlStoreEntryTooltipExternalCrt.visibleProperty());
this.ctlStoreEntryTooltipPublicCrt.managedProperty().bind(this.ctlStoreEntryTooltipPublicCrt.visibleProperty());
this.ctlStoreEntryTooltipPrivateCrt.managedProperty().bind(this.ctlStoreEntryTooltipPrivateCrt.visibleProperty());
this.ctlStoreEntryTooltipCsr.managedProperty().bind(this.ctlStoreEntryTooltipCsr.visibleProperty());
this.ctlStoreEntryTooltipCrl.managedProperty().bind(this.ctlStoreEntryTooltipCrl.visibleProperty());
this.ctlStoreEntryTooltipKey.managedProperty().bind(this.ctlStoreEntryTooltipKey.visibleProperty());
this.ctlStoreEntryTooltipRevokedCrt.managedProperty().bind(this.ctlStoreEntryTooltipRevokedCrt.visibleProperty());
this.ctlStoreEntryTooltipInvalidCrt.managedProperty().bind(this.ctlStoreEntryTooltipInvalidCrt.visibleProperty());
this.ctlStoreEntryView.setTooltip(null);
this.ctlStoreEntryViewId.setCellFactory(param -> {
return new TreeTableCell<StoreEntryModel, String>() {
Tooltip tooltip = storeEntryViewTooltip;
@Override
protected void updateItem(@Nullable String item, boolean empty) {
if (!empty) {
setTooltip(this.tooltip);
setOnMouseEntered(StoreController.this::onStoreViewItemMouseEntered);
setText(item);
} else {
setTooltip(null);
setOnMouseEntered(null);
setText(null);
}
}
};
});
this.ctlStoreEntryViewId.setCellValueFactory(new TreeItemPropertyValueFactory<>("id"));
this.ctlStoreEntryViewName.setCellValueFactory(new TreeItemPropertyValueFactory<>("name"));
this.ctlStoreEntryViewSerial.setCellValueFactory(new TreeItemPropertyValueFactory<>("serial"));
this.ctlStoreEntryViewExpires.setCellValueFactory(new TreeItemPropertyValueFactory<>("expires"));
ContextMenu detailsViewMenu = this.ctlDetailsView.getContextMenu();
this.ctlDetailsView.setContextMenu(null);
this.ctlDetailsView.setRowFactory(param -> {
ContextMenu menu = detailsViewMenu;
return new TreeTableRow<AttributeModel>() {
@Override
protected void updateItem(@Nullable AttributeModel item, boolean empty) {
super.updateItem(item, empty);
if (!empty) {
setContextMenu(menu);
} else {
setContextMenu(null);
}
}
};
});
this.ctlDetailsViewName.setCellValueFactory(new TreeItemPropertyValueFactory<>("name"));
this.ctlDetailsViewValue.setCellValueFactory(new TreeItemPropertyValueFactory<>("value"));
this.ctlStoreEntryView.getSelectionModel().selectedItemProperty().addListener((p, o, n) -> onStoreViewSelectionChanged(n));
Windows.onHiding(stage, (ScheduledFuture<?> f) -> f.cancel(true), getExecutorService().scheduleAtFixedRate(PlatformHelper.runLaterRunnable(() -> onUpdateHeapStatus()), 0, 500, TimeUnit.MILLISECONDS));
}
use of javafx.scene.control.Tooltip in project pmd by pmd.
the class MainDesignerController method updateRecentFilesMenu.
private void updateRecentFilesMenu() {
List<MenuItem> items = new ArrayList<>();
List<File> filesToClear = new ArrayList<>();
for (final File f : recentFiles) {
if (f.exists() && f.isFile()) {
CustomMenuItem item = new CustomMenuItem(new Label(f.getName()));
item.setOnAction(e -> loadSourceFromFile(f));
item.setMnemonicParsing(false);
Tooltip.install(item.getContent(), new Tooltip(f.getAbsolutePath()));
items.add(item);
} else {
filesToClear.add(f);
}
}
recentFiles.removeAll(filesToClear);
if (items.isEmpty()) {
openRecentMenu.setDisable(true);
return;
}
Collections.reverse(items);
items.add(new SeparatorMenuItem());
MenuItem clearItem = new MenuItem();
clearItem.setText("Clear menu");
clearItem.setOnAction(e -> {
recentFiles.clear();
openRecentMenu.setDisable(true);
});
items.add(clearItem);
openRecentMenu.getItems().setAll(items);
}
use of javafx.scene.control.Tooltip in project kanonizo by kanonizo.
the class KanonizoFrame method addParams.
private void addParams(Object alg, GridPane paramLayout, boolean runPrerequisites) {
List<Field> params = Arrays.asList(alg.getClass().getFields()).stream().filter(f -> f.getAnnotation(Parameter.class) != null).collect(Collectors.toList());
int row = 0;
int col = -1;
for (Field param : params) {
if (col + 2 > ITEMS_PER_ROW * 2) {
col = -1;
row++;
}
Label paramLabel = new Label(Util.humanise(param.getName()) + ":");
paramLabel.setAlignment(Pos.CENTER_LEFT);
paramLabel.setTooltip(new Tooltip(Util.humanise(param.getName())));
Control paramField = getParameterField(param, runPrerequisites);
paramField.setTooltip(new Tooltip(param.getAnnotation(Parameter.class).description()));
paramLayout.add(paramLabel, ++col, row, 1, 1);
paramLayout.add(paramField, ++col, row, 1, 1);
if (param.isAnnotationPresent(ConditionalParameter.class)) {
String condition = param.getAnnotation(ConditionalParameter.class).condition();
String[] listensTo = param.getAnnotation(ConditionalParameter.class).listensTo().split(",");
for (String listen : listensTo) {
Util.addPropertyChangeListener(listen, (e) -> {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("nashorn");
try {
Class<?> container = param.getDeclaringClass();
engine.put("CallerClass", container);
engine.eval("var " + container.getSimpleName() + " = CallerClass.static");
boolean cond = (boolean) engine.eval(condition);
paramField.setDisable(!cond);
paramLabel.setDisable(!cond);
} catch (ScriptException ex) {
logger.error(ex);
}
});
}
}
}
}
Aggregations