use of javafx.scene.input.KeyCodeCombination in project jphp by jphp-compiler.
the class KeyboardManager method trigger.
protected void trigger(boolean down) {
List<KeyCombination.Modifier> modifiers = new ArrayList<>();
if (shiftDown) {
modifiers.add(SHIFT_DOWN);
}
if (controlDown) {
modifiers.add(KeyCombination.CONTROL_DOWN);
}
if (altDown) {
modifiers.add(KeyCombination.ALT_DOWN);
}
KeyCombination.Modifier[] modifiersArray = modifiers.toArray(new KeyCombination.Modifier[modifiers.size()]);
for (Map.Entry<KeyCode, KeyEvent> entry : keys.entrySet()) {
KeyCode code;
try {
code = entry.getKey();
} catch (IllegalStateException e) {
continue;
}
if (code == null || code == KeyCode.UNDEFINED) {
continue;
}
KeyCodeCombination keyCombination;
try {
keyCombination = new KeyCodeCombination(code, modifiersArray);
} catch (IllegalArgumentException e) {
continue;
}
trigger(keyCombination, down);
if (modifiersArray.length > 0) {
keyCombination = new KeyCodeCombination(code);
trigger(keyCombination, down);
}
}
}
use of javafx.scene.input.KeyCodeCombination in project Gargoyle by callakrsos.
the class SqlPane method createTreeContextMenu.
/**
* 컨텍스트 메뉴 생성 및 기능 적용
*
*
* 2016-10-27 키 이벤트를 setAccelerator를 사용하지않고 이벤트 방식으로 변경 이유 : 도킹기능을 적용하하면
* setAccelerator에 등록된 이벤트가 호출안됨
*
* @param schemaTree2
*/
private void createTreeContextMenu(TreeView<K> schemaTree) {
MenuItem menuSelectScript = new MenuItem("Select Script");
menuSelectScript.setOnAction(this::applySelectScript);
MenuItem menuUpdateScript = new MenuItem("Update Script");
menuUpdateScript.setOnAction(this::applyUpdateScript);
MenuItem menuDeleteScript = new MenuItem("Delete Script");
menuDeleteScript.setOnAction(this::applyDeleteSelectScript);
MenuItem menuInsertScript = new MenuItem("Insert Script");
menuInsertScript.setOnAction(this::applyInsertScript);
Menu menu = new Menu("Script", null, menuSelectScript, menuUpdateScript, menuDeleteScript, menuInsertScript);
// MenuItem menuPrimaryKeys = new MenuItem("Primary Keys");
MenuItem menuShowData = new MenuItem("Show 100 rows [F1]");
menuShowData.setOnAction(this::show100RowAction);
MenuItem menuEditShowData = new MenuItem("Show Editable View [CTRL + F1]");
menuEditShowData.setOnAction(this::menuEditShowDataAction);
MenuItem menuFindTable = new MenuItem("Find Table [CTRL + SHIFT + R]");
// menuFindTable.setAccelerator(new KeyCodeCombination(KeyCode.R,
// KeyCombination.CONTROL_DOWN));
menuFindTable.setOnAction(this::showFileTableOnAction);
MenuItem menuProperties = new MenuItem("Properties");
menuProperties.setOnAction(this::showProperties);
MenuItem menuReflesh = new MenuItem("Reflesh [F5]");
// menuReflesh.setOnAction(this::menuRefleshOnAction);
menuReflesh.setAccelerator(new KeyCodeCombination(KeyCode.F5));
ContextMenu contextMenu = new ContextMenu(menu, menuShowData, menuEditShowData, menuFindTable, menuProperties, new SeparatorMenuItem(), menuReflesh);
schemaTree.setContextMenu(contextMenu);
}
use of javafx.scene.input.KeyCodeCombination in project bitsquare by bitsquare.
the class PeerInfoWithTagEditor method addContent.
protected void addContent() {
FormBuilder.addLabelTextField(gridPane, ++rowIndex, "Onion address:", hostName).second.setMouseTransparent(false);
FormBuilder.addLabelTextField(gridPane, ++rowIndex, "Number of completed trades:", String.valueOf(numTrades));
inputTextField = FormBuilder.addLabelInputTextField(gridPane, ++rowIndex, "Set tag for that peer:").second;
Map<String, String> peerTagMap = Preferences.INSTANCE.getPeerTagMap();
String tag = peerTagMap.containsKey(hostName) ? peerTagMap.get(hostName) : "";
inputTextField.setText(tag);
keyEventEventHandler = event -> {
if (new KeyCodeCombination(KeyCode.R, KeyCombination.ALT_DOWN).match(event)) {
new SendPrivateNotificationWindow(offer.getPubKeyRing(), offer.getOffererNodeAddress()).onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid).show();
}
};
}
use of javafx.scene.input.KeyCodeCombination in project bitsquare by bitsquare.
the class TransactionsView method initialize.
@Override
public void initialize() {
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.setPlaceholder(new Label("No transactions available"));
setDateColumnCellFactory();
setDetailsColumnCellFactory();
setAddressColumnCellFactory();
setTransactionColumnCellFactory();
setAmountColumnCellFactory();
setConfidenceColumnCellFactory();
setRevertTxColumnCellFactory();
dateColumn.setComparator((o1, o2) -> o1.getDate().compareTo(o2.getDate()));
detailsColumn.setComparator((o1, o2) -> {
String id1 = o1.getTradable() != null ? o1.getTradable().getId() : o1.getDetails();
String id2 = o2.getTradable() != null ? o2.getTradable().getId() : o2.getDetails();
return id1.compareTo(id2);
});
addressColumn.setComparator((o1, o2) -> o1.getAddressString().compareTo(o2.getAddressString()));
transactionColumn.setComparator((o1, o2) -> o1.getTxId().compareTo(o2.getTxId()));
amountColumn.setComparator((o1, o2) -> o1.getAmountAsCoin().compareTo(o2.getAmountAsCoin()));
confidenceColumn.setComparator((o1, o2) -> Double.valueOf(o1.getTxConfidenceIndicator().getProgress()).compareTo(o2.getTxConfidenceIndicator().getProgress()));
dateColumn.setSortType(TableColumn.SortType.DESCENDING);
tableView.getSortOrder().add(dateColumn);
walletEventListener = new WalletEventListener() {
@Override
public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) {
updateList();
}
@Override
public void onCoinsSent(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) {
updateList();
}
@Override
public void onReorganize(Wallet wallet) {
updateList();
}
@Override
public void onTransactionConfidenceChanged(Wallet wallet, Transaction tx) {
}
@Override
public void onWalletChanged(Wallet wallet) {
updateList();
}
@Override
public void onScriptsChanged(Wallet wallet, List<Script> scripts, boolean isAddingScripts) {
updateList();
}
@Override
public void onKeysAdded(List<ECKey> keys) {
updateList();
}
};
keyEventEventHandler = event -> {
if (new KeyCodeCombination(KeyCode.R, KeyCombination.ALT_DOWN).match(event))
revertTxColumn.setVisible(!revertTxColumn.isVisible());
else if (new KeyCodeCombination(KeyCode.A, KeyCombination.ALT_DOWN).match(event))
showStatisticsPopup();
};
exportButton.setText("Export to csv");
}
use of javafx.scene.input.KeyCodeCombination in project Gargoyle by callakrsos.
the class CodeAreaFindAndReplaceHelper 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;
}
Aggregations