• R/O
  • SSH
  • HTTPS

wolf-desktop: コミット


コミットメタ情報

リビジョン374 (tree)
日時2015-04-03 16:46:00
作者l_v_yonsama

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- Libraries/Common/src/hiro/yoshioka/util/ui/MySubjectControlContentAssistant.java (revision 373)
+++ Libraries/Common/src/hiro/yoshioka/util/ui/MySubjectControlContentAssistant.java (revision 374)
@@ -1,5 +1,8 @@
11 package hiro.yoshioka.util.ui;
22
3+import hiro.yoshioka.util.StringUtil;
4+import hiro.yoshioka.util.Util;
5+
36 import java.util.ArrayList;
47
58 import org.eclipse.jface.contentassist.SubjectControlContentAssistant;
@@ -7,6 +10,8 @@
710 import org.eclipse.jface.text.IDocument;
811 import org.eclipse.swt.SWT;
912 import org.eclipse.swt.custom.VerifyKeyListener;
13+import org.eclipse.swt.dnd.TextTransfer;
14+import org.eclipse.swt.dnd.Transfer;
1015 import org.eclipse.swt.events.VerifyEvent;
1116 import org.eclipse.swt.widgets.Text;
1217
@@ -25,19 +30,44 @@
2530 install(adapter);
2631 adapter.appendVerifyKeyListener(new VerifyKeyListener() {
2732 public void verifyKey(VerifyEvent event) {
33+
34+ System.out.println("CTRL=" + (event.stateMask == SWT.CTRL) + "char=" + event.character);
35+
2836 if (event.stateMask == SWT.CTRL && event.character == ' ') {
2937 try {
3038 showPossibleCompletions();
3139 event.doit = false;
3240 } catch (RuntimeException e) {
33- e.printStackTrace();
3441 }
35-
42+ } else if (event.stateMask == SWT.CTRL
43+ && event.character == 'a') {
44+ System.out.println("text.getText()=" + text.getText());
45+ if (text.getText().length() > 0) {
46+ text.setSelection(0, text.getText().length());
47+ System.out.println("text.set selectioned()");
48+ }
49+ event.doit = false;
50+ } else if (event.stateMask == SWT.CTRL
51+ && event.character == 'v') {
52+ String str = (String) Util.getClipboard().getContents(
53+ TextTransfer.getInstance());
54+ System.out.println("text ctrl _v =" + str);
55+ text.setText(str);
56+ for (int i = 0; i < listener.size(); i++) {
57+ listener.get(i).pressEnter(text.getText());
58+ }
59+ event.doit = false;
60+ } else if (event.stateMask == SWT.CTRL
61+ && event.character == 'c') {
62+ System.out.println("text ctrl _c =" + text.getSelectionText());
63+ if (!StringUtil.isEmpty(text.getSelectionText())) {
64+ Util.getClipboard().setContents(
65+ new Object[] { text.getSelectionText() },
66+ new Transfer[] { TextTransfer.getInstance() });
67+ }
68+ event.doit = false;
3669 } else if (event.character == '\r' || event.character == '\n') {
3770 for (int i = 0; i < listener.size(); i++) {
38- // System.out.println("text[" + i + "]=" + text);
39- // System.out.println("event.text=" + event.text);
40- // System.out.println("event.data=" + event.data);
4171 listener.get(i).pressEnter(text.getText());
4272 }
4373 event.doit = false;
--- Libraries/Common/src/hiro/yoshioka/util/ui/MySubjectControlContentAssistProcessor.java (revision 373)
+++ Libraries/Common/src/hiro/yoshioka/util/ui/MySubjectControlContentAssistProcessor.java (revision 374)
@@ -36,7 +36,7 @@
3636 System.out.println();
3737 System.out.println();
3838 System.out.println();
39- System.out.println("quali=" + qualifier);
39+ System.out.println("quali123=" + qualifier);
4040 for (int i = 0; i < fCompletionStrings.length; i++) {
4141 if (fCompletionStrings[i].toUpperCase().startsWith(
4242 qualifier.toUpperCase())) {
旧リポジトリブラウザで表示