io.github.factoryfx.javafx.view.ViewDescription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafxFactoryEditing Show documentation
Show all versions of javafxFactoryEditing Show documentation
factoryfx dependency injection framework
package io.github.factoryfx.javafx.view;
import io.github.factoryfx.factory.util.LanguageText;
import io.github.factoryfx.javafx.util.UniformDesign;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Tab;
import javafx.stage.Stage;
import org.controlsfx.glyphfont.FontAwesome;
public class ViewDescription {
private final LanguageText text;
private final FontAwesome.Glyph icon;
private final UniformDesign uniformDesign;
public ViewDescription(LanguageText text, FontAwesome.Glyph icon, UniformDesign uniformDesign) {
this.text = text;
this.icon = icon;
this.uniformDesign = uniformDesign;
}
public void describeMenuItem(MenuItem menuItem){
menuItem.setText(uniformDesign.getText(text));
uniformDesign.addIcon(menuItem,icon);
}
public void describeTabView(Tab tab) {
tab.setText(uniformDesign.getText(text));
uniformDesign.addIcon(tab,icon);
}
public void describeStageView(Stage stage) {
stage.setTitle(uniformDesign.getText(text));
}
}