Search in sources :

Example 16 with KeyCodeCombination

use of javafx.scene.input.KeyCodeCombination in project Gargoyle by callakrsos.

the class PagedCodeAreaFindAndReplaceHelper method createMenus.

/**
	 *  FindAndReplace에 대한 메뉴를 정의.
	 * @return
	 * @작성자 : KYJ
	 * @작성일 : 2017. 1. 13.
	 */
public Menu createMenus() {
    menuSearch = new Menu("Search");
    miFindReplace = new MenuItem("Find/Replace");
    miFindReplace.setAccelerator(new KeyCodeCombination(KeyCode.F, KeyCombination.CONTROL_DOWN));
    miFindReplace.setOnAction(this::findReplaceEvent);
    menuSearch.getItems().add(miFindReplace);
    return menuSearch;
}
Also used : MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu)

Example 17 with KeyCodeCombination

use of javafx.scene.input.KeyCodeCombination in project Gargoyle by callakrsos.

the class MacroSqlComposite method post.

@FxPostInitialize
public void post() {
    MenuItem menuAddItem = new MenuItem("Add");
    menuAddItem.setAccelerator(new KeyCodeCombination(KeyCode.INSERT, KeyCharacterCombination.CONTROL_DOWN));
    menuAddItem.setOnAction(e -> {
        addOnAction();
    });
    MenuItem menuDeleteItem = new MenuItem("Delete");
    menuDeleteItem.setAccelerator(new KeyCodeCombination(KeyCode.DELETE, KeyCharacterCombination.CONTROL_DOWN));
    menuDeleteItem.setOnAction(e -> {
        addOnAction();
    });
    tvFavorite.setContextMenu(new ContextMenu(menuAddItem, menuDeleteItem));
    borContent.setCenter(new MacroControl(connectionSupplier, initText));
    MacroFavorTreeItemCreator macroFavorTreeItem = new MacroFavorTreeItemCreator(connectionSupplier);
    MacroItemVO f = new MacroItemVO();
    tvFavorite.setRoot(macroFavorTreeItem.createRoot(f));
    tvFavorite.setShowRoot(false);
}
Also used : MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) ContextMenu(javafx.scene.control.ContextMenu) FxPostInitialize(com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize)

Example 18 with KeyCodeCombination

use of javafx.scene.input.KeyCodeCombination in project TestFX by TestFX.

the class TypeRobotImplTest method push_with_combination_for_ALT_A.

@Test
public void push_with_combination_for_ALT_A() {
    // when:
    typeRobot.push(new KeyCodeCombination(A, ALT_DOWN));
    // then:
    verify(keyboardRobot, times(1)).pressNoWait(eq(ALT), eq(A));
    verify(keyboardRobot, times(1)).release(eq(A), eq(ALT));
    verifyNoMoreInteractions(keyboardRobot);
}
Also used : KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Test(org.junit.Test)

Example 19 with KeyCodeCombination

use of javafx.scene.input.KeyCodeCombination in project TestFX by TestFX.

the class MenuBarTest method setup.

@Before
public void setup() throws Exception {
    FxToolkit.setupStage(stage -> {
        Menu fileMenu = new Menu("File");
        fileMenu.setId("fileMenu");
        MenuItem newItem = new MenuItem("New");
        newItem.setId("newItem");
        newItem.setOnAction(actionEvent -> newMenuShownLatch.countDown());
        fileMenu.getItems().add(newItem);
        MenuItem saveAsItem = new MenuItem("Save As..............................");
        saveAsItem.setId("saveAsItem");
        saveAsItem.setAccelerator(new KeyCodeCombination(KeyCode.A, KeyCombination.SHORTCUT_DOWN, KeyCombination.CONTROL_DOWN));
        fileMenu.getItems().add(saveAsItem);
        editMenu = new Menu("Edit");
        editMenu.setId("editMenu");
        MenuItem cutItem = new MenuItem("cut");
        cutItem.setId("cutItem");
        editMenu.getItems().add(cutItem);
        MenuBar menuBar = new MenuBar(fileMenu, editMenu);
        StackPane pane = new StackPane(new VBox(menuBar));
        pane.setAlignment(Pos.CENTER);
        Scene scene = new Scene(pane, 300, 400);
        stage.setScene(scene);
        stage.show();
    });
}
Also used : MenuBar(javafx.scene.control.MenuBar) MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) StackPane(javafx.scene.layout.StackPane) Before(org.junit.Before)

Example 20 with KeyCodeCombination

use of javafx.scene.input.KeyCodeCombination in project bmoth by hhu-stups.

the class AppView method initialize.

@Override
public void initialize(URL location, ResourceBundle resources) {
    save.setAccelerator(new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_ANY));
    newFile.setAccelerator(new KeyCodeCombination(KeyCode.N, KeyCombination.CONTROL_ANY));
    open.setAccelerator(new KeyCodeCombination(KeyCode.O, KeyCombination.CONTROL_ANY));
    warningArea.setWrapText(true);
    presentation.setAccelerator(new KeyCodeCombination(KeyCode.P, KeyCombination.CONTROL_ANY));
    codeArea.selectRange(0, 0);
    codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea));
    // XXX
    codeArea.richChanges().filter(ch -> !ch.getInserted().equals(ch.getRemoved())).subscribe(change -> codeArea.setStyleSpans(0, Highlighter.computeHighlighting(codeArea.getText())));
    codeArea.setStyleSpans(0, Highlighter.computeHighlighting(codeArea.getText()));
    codeArea.textProperty().addListener((observableValue, s, t1) -> {
        hasChanged = true;
        infoArea.setText("Unsaved changes");
    });
    appViewModel.codeProperty().bind(codeArea.textProperty());
    warningArea.textProperty().bind(appViewModel.warningsProperty());
    EventBusProvider.getInstance();
    EventBusProvider.getInstance().getEventBus().register(this);
}
Also used : InitialStateExistsChecker(de.bmoth.checkers.initialstateexists.InitialStateExistsChecker) Scene(javafx.scene.Scene) Initializable(javafx.fxml.Initializable) javafx.scene.control(javafx.scene.control) URL(java.net.URL) ParserException(de.bmoth.parser.ParserException) LineNumberFactory(org.fxmisc.richtext.LineNumberFactory) KeyCombination(javafx.scene.input.KeyCombination) Level(java.util.logging.Level) EventBus(com.google.common.eventbus.EventBus) Parent(javafx.scene.Parent) Task(javafx.concurrent.Task) BoundedModelChecker(de.bmoth.modelchecker.bmc.BoundedModelChecker) InitialStateExistsCheckingResult(de.bmoth.checkers.initialstateexists.InitialStateExistsCheckingResult) ResourceBundle(java.util.ResourceBundle) InvariantSatisfiabilityCheckingResult(de.bmoth.checkers.invariantsatisfiability.InvariantSatisfiabilityCheckingResult) Subscribe(com.google.common.eventbus.Subscribe) Status(com.microsoft.z3.Status) InjectViewModel(de.saxsys.mvvmfx.InjectViewModel) KInductionModelChecker(de.bmoth.modelchecker.kind.KInductionModelChecker) BMothPreferences(de.bmoth.preferences.BMothPreferences) InvariantSatisfiabilityChecker(de.bmoth.checkers.invariantsatisfiability.InvariantSatisfiabilityChecker) ErrorEvent(de.bmoth.eventbus.ErrorEvent) Parser(de.bmoth.parser.Parser) KeyCode(javafx.scene.input.KeyCode) MachineNode(de.bmoth.parser.ast.nodes.MachineNode) Files(java.nio.file.Files) FluentViewLoader(de.saxsys.mvvmfx.FluentViewLoader) FileWriter(java.io.FileWriter) IOException(java.io.IOException) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) CodeArea(org.fxmisc.richtext.CodeArea) Logger(java.util.logging.Logger) ExplicitStateModelChecker(de.bmoth.modelchecker.esmc.ExplicitStateModelChecker) File(java.io.File) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) FileChooser(javafx.stage.FileChooser) ActionEvent(javafx.event.ActionEvent) Region(javafx.scene.layout.Region) ViewTuple(de.saxsys.mvvmfx.ViewTuple) Stage(javafx.stage.Stage) Paths(java.nio.file.Paths) EventBusProvider(de.bmoth.eventbus.EventBusProvider) FxmlView(de.saxsys.mvvmfx.FxmlView) Optional(java.util.Optional) ModelChecker(de.bmoth.modelchecker.ModelChecker) KeyCodeCombination(javafx.scene.input.KeyCodeCombination)

Aggregations

KeyCodeCombination (javafx.scene.input.KeyCodeCombination)21 MenuItem (javafx.scene.control.MenuItem)10 Menu (javafx.scene.control.Menu)9 ContextMenu (javafx.scene.control.ContextMenu)5 Scene (javafx.scene.Scene)4 KeyCode (javafx.scene.input.KeyCode)4 KeyCombination (javafx.scene.input.KeyCombination)4 Popup (io.bitsquare.gui.main.overlays.popups.Popup)3 File (java.io.File)3 MenuBar (javafx.scene.control.MenuBar)3 SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)3 IOException (java.io.IOException)2 Optional (java.util.Optional)2 Platform (javafx.application.Platform)2 ObservableList (javafx.collections.ObservableList)2 Insets (javafx.geometry.Insets)2 TextField (javafx.scene.control.TextField)2 KeyEvent (javafx.scene.input.KeyEvent)2 VBox (javafx.scene.layout.VBox)2 FileChooser (javafx.stage.FileChooser)2