• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Moxkiriyaプロジェクト事前開発用の作業部屋


Commit MetaInfo

修訂7d68da5a4b424a88189469bb9f3dccb0f126e5de (tree)
時間2018-10-20 10:25:20
作者Harold_Andoh <andolloyd@gmai...>
CommiterHarold_Andoh

Log Message

[Moxkiriya7]

  • WebViewのコンテキストメニューを無効に修正
  • Search
    WikiテキストフィールドでEnterキー押下で全文検索を実行するように修正

Change Summary

差異

--- a/src/com/wiki/standalone/moxkiriya/WikiMainWindow.fxml
+++ b/src/com/wiki/standalone/moxkiriya/WikiMainWindow.fxml
@@ -64,7 +64,7 @@
6464 <Font size="20.0" fx:id="x2" />
6565 </font>
6666 </Button>
67- <TextField id="TextFieldSearchWiki" fx:id="webViewMenuAnchorPaneTextFieldSearchWiki" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="35.0" prefWidth="256.0" promptText="%key.TextField.Search_Wiki" AnchorPane.rightAnchor="85.0" AnchorPane.topAnchor="2.0" />
67+ <TextField id="TextFieldSearchWiki" fx:id="webViewMenuAnchorPaneTextFieldSearchWiki" maxHeight="-Infinity" maxWidth="-Infinity" onKeyPressed="#onKeyPressedTextFieldSearchWiki" prefHeight="35.0" prefWidth="256.0" promptText="%key.TextField.Search_Wiki" AnchorPane.rightAnchor="85.0" AnchorPane.topAnchor="2.0" />
6868 <Button id="ButtonSearch" fx:id="webViewMenuAnchorPaneButtonSearch" maxHeight="-Infinity" maxWidth="-Infinity" mnemonicParsing="false" onAction="#onActionButtonSearch" prefHeight="35.0" prefWidth="80.0" text="%key.Button.Search" AnchorPane.rightAnchor="2.0" AnchorPane.topAnchor="2.0" />
6969 </children>
7070 <padding>
--- a/src/com/wiki/standalone/moxkiriya/WikiMainWindowController.java
+++ b/src/com/wiki/standalone/moxkiriya/WikiMainWindowController.java
@@ -60,6 +60,8 @@ import javafx.scene.control.TextField;
6060 import javafx.scene.control.cell.CheckBoxTableCell;
6161 import javafx.scene.control.cell.PropertyValueFactory;
6262 import javafx.scene.image.ImageView;
63+import javafx.scene.input.KeyCode;
64+import javafx.scene.input.KeyEvent;
6365 import javafx.scene.layout.AnchorPane;
6466 import javafx.scene.layout.FlowPane;
6567 import javafx.scene.web.WebEngine;
@@ -214,7 +216,9 @@ public class WikiMainWindowController implements Initializable {
214216 @Override
215217 public void initialize(URL url, ResourceBundle resourceBundle) {
216218 resourceBundle_ = resourceBundle;
219+
217220 setLinkClickListner(webView.getEngine());
221+ webView.setContextMenuEnabled(false);
218222
219223 previewWindow_ = new WikiPreviewWindow(stage_, resourceBundle_);
220224 previewWindow_.setMainWindowController(this);
@@ -513,23 +517,22 @@ public class WikiMainWindowController implements Initializable {
513517 }
514518
515519 @FXML
516- public void onActionButtonSearch(ActionEvent event) {
520+ public void onKeyPressedTextFieldSearchWiki(KeyEvent event) {
517521 try {
518- String key = webViewMenuAnchorPaneTextFieldSearchWiki.getText();
519-
520- if(key.isEmpty() != true) {
521- HashMap<String, PageData> map = wikiEngine_.queryPageFullTextSearch(key);
522-
523- wikiEngine_.setPageDataMap(map);
524- loadWikiContent();
525-
526- webViewHyperlinkMain.setId("webViewMainHyperlinkActive");
527- webViewHyperlinkHistory.setId("webViewMainHyperlinkInactive");
528- webViewAnchorPaneMain.setVisible(true);
529- webViewAnchorPaneHistory.setVisible(false);
522+ if(event.getCode().equals(KeyCode.ENTER) == true) {
523+ doSearchWiki();
530524 }
531525 } catch (Exception e) {
532526 e.printStackTrace();
527+ }
528+ }
529+
530+ @FXML
531+ public void onActionButtonSearch(ActionEvent event) {
532+ try {
533+ doSearchWiki();
534+ } catch (Exception e) {
535+ e.printStackTrace();
533536 }
534537 }
535538
@@ -990,6 +993,7 @@ public class WikiMainWindowController implements Initializable {
990993 e.printStackTrace();
991994 }
992995 }
996+
993997 /**
994998 * Latest contents getter.
995999 * @return PageData
@@ -1040,7 +1044,7 @@ public class WikiMainWindowController implements Initializable {
10401044 e.printStackTrace();
10411045 }
10421046 }
1043-
1047+
10441048 /**
10451049 * ページ内の指定セクションリンクへジャンプする。
10461050 * @param target
@@ -1069,6 +1073,26 @@ public class WikiMainWindowController implements Initializable {
10691073 public ImageView getImageViewLoading() {
10701074 return ImageViewLoading;
10711075 }
1076+
1077+ /**
1078+ * Execute search wiki.
1079+ * @throws Exception
1080+ */
1081+ private void doSearchWiki() throws Exception {
1082+ String key = webViewMenuAnchorPaneTextFieldSearchWiki.getText();
1083+
1084+ if(key.isEmpty() != true) {
1085+ HashMap<String, PageData> map = wikiEngine_.queryPageFullTextSearch(key);
1086+
1087+ wikiEngine_.setPageDataMap(map);
1088+ loadWikiContent();
1089+
1090+ webViewHyperlinkMain.setId("webViewMainHyperlinkActive");
1091+ webViewHyperlinkHistory.setId("webViewMainHyperlinkInactive");
1092+ webViewAnchorPaneMain.setVisible(true);
1093+ webViewAnchorPaneHistory.setVisible(false);
1094+ }
1095+ }
10721096
10731097 /**
10741098 * 選択中または現在表示中のコンテンツのディレクトリを取得する。