Skip to content

Instantly share code, notes, and snippets.

View amoAHCP's full-sized avatar

Andy Moncsek amoAHCP

View GitHub Profile
public class ApplicationLauncher extends AFXSpringXmlLauncher {
/**
** specify the spring xml
*/
@Override
public String getXmlConfig() {
return "main.xml";
}
public class ApplicationLauncher extends AFXSpringJavaConfigLauncher {
@Override
protected Class<?>[] getConfigClasses() {
return new Class<?>[]{BaseConfiguration.class};
}
@Override
protected Class<? extends FXWorkbench> getWorkbenchClass() {
return JacpFXWorkbench.class;
@View(id = ComponentIds.COMPONENT__TWO,
name = "SimpleView",
active = true,
resourceBundleLocation = "bundles.languageBundle",
initialTargetLayoutId = PerspectiveIds.TARGET__CONTAINER_MAIN)
public class ComponentTwo implements FXComponent {
@Resource
private Context context;
private VBox rootPane;
...
@Fragment(id = BaseConfiguration.FRAGMENT_TWO,
resourceBundleLocation = "bundles.languageBundle",
localeID = "en_US",
scope = Scope.PROTOTYPE)
public class FragmentTwo extends VBox {
@Resource
private Context context;
@Resource
private ResourceBundle bundle;
<VBox fx:id="rootPane" xmlns="http://javafx.com/javafx/8"
xmlns:fx="http://javafx.com/fxml/1" HBox.hgrow="ALWAYS" style="-fx-background-color:#f5f5f5">
<children>
<HBox fx:id="top">
<children>
<Label text="Phone:"/>
<Button text="OK" onAction="#send" />
</children>
</HBox>
...
@Fragment(id = BaseConfiguration.FRAGMENT_ONE,
viewLocation = "/fxml/FragmentOne.fxml",
resourceBundleLocation = "bundles.languageBundle",
localeID = "en_US",
scope = Scope.PROTOTYPE)
public class FragmentOne {
@Resource
private Context context;
@Resource
private ResourceBundle bundle;
@Component(id = BasicConfig.STATELESS_CALLBACK,
name = "statelessCallback",
active = true,
localeID = "en_US",
resourceBundleLocation = "bundles.languageBundle"
)
@Stateless
public class StatelessCallback implements CallbackComponent {
@Resource
@Component(id = BasicConfig.STATEFUL_CALLBACK,
name = "statefulCallback",
active = true,
localeID = "en_US",
resourceBundleLocation = "bundles.languageBundle")
public class StatefulCallback implements CallbackComponent {
@Resource
private Context context;
private int c = 0;
<VBox fx:id="rootPane" xmlns="http://javafx.com/javafx/8"
xmlns:fx="http://javafx.com/fxml/1" HBox.hgrow="ALWAYS">
<children>
<HBox fx:id="top">
...
</HBox>
<HBox fx:id="bottom">
...
</HBox>
</children>
@DeclarativeView(id = ComponentIds.COMPONENT_ONE,
name = "SimpleView",
active = true,
resourceBundleLocation = "bundles.languageBundle",
initialTargetLayoutId = PerspectiveIds.TARGET_CONTAINER_TOP,
<b>viewLocation = "/fxml/ComponentOne.fxml")</b>
public class ComponentOne implements FXComponent {
@FXML
private VBox rootPane;
@FXML