![JAR search and dependency download from the Maven repository](/logo.png)
org.datafx.controller.flow.context.LinkActionResourceConsumer Maven / Gradle / Ivy
package org.datafx.controller.flow.context;
import javafx.scene.Node;
import javafx.scene.control.MenuItem;
import org.datafx.controller.context.ViewContext;
import org.datafx.controller.context.resource.ControllerResourceConsumer;
import org.datafx.controller.flow.action.LinkAction;
public class LinkActionResourceConsumer implements ControllerResourceConsumer {
@Override
public void consumeResource(LinkAction annotation, Object resource, ViewContext> context) {
FlowActionHandler actionHandler = context.getRegisteredObject(ViewFlowContext.class).getRegisteredObject(FlowActionHandler.class);
if (resource != null) {
if (resource instanceof MenuItem) {
actionHandler.attachLinkEventHandler((MenuItem) resource, annotation.value());
} else if (resource instanceof Node) {
actionHandler.attachLinkEventHandler((Node) resource, annotation.value());
}
}
}
@Override
public Class getSupportedAnnotation() {
return LinkAction.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy