author | Matti Laitinen <matti.t.laitinen@nokia.com> |
Wed, 21 Apr 2010 19:42:48 +0300 | |
changeset 6 | f65f740e69f9 |
parent 1 | 1050670c6980 |
permissions | -rw-r--r-- |
1
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
6
f65f740e69f9
AnalyzeTool Carbide Extension v1.9.0
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
1
diff
changeset
|
2 |
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
1
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Definitions for the class CustomInputDialog |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
17 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.s60tools.analyzetool.ui; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
19 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
20 |
import org.eclipse.jface.dialogs.IInputValidator; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
21 |
import org.eclipse.jface.dialogs.InputDialog; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
22 |
import org.eclipse.jface.window.Window; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
23 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
24 |
import com.nokia.s60tools.analyzetool.Activator; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
25 |
import com.nokia.s60tools.analyzetool.global.Constants; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
26 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
27 |
/** |
6
f65f740e69f9
AnalyzeTool Carbide Extension v1.9.0
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
1
diff
changeset
|
28 |
* Provides input dialog. Checks that user input does not contain spaces. |
1
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
29 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
30 |
* @author kihe |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
31 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
32 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
33 |
public class CustomInputDialog implements IInputValidator { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
34 |
/** Dialog default value. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
35 |
private final String defaultValue; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
36 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
37 |
/** Dialog hint text. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
38 |
private final String dialogHintText; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
39 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
40 |
/** Dialog title. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
41 |
private final String dialogTitle; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
42 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
43 |
/** User input. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
44 |
private String input = ""; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
45 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
46 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
47 |
* Constructor. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
48 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
49 |
* @param title |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
50 |
* Dialog title |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
51 |
* @param hintText |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
52 |
* Dialog hint text |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
53 |
* @param defaultVal |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
54 |
* Dialog default input |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
55 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
56 |
public CustomInputDialog(final String title, final String hintText, |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
57 |
final String defaultVal) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
58 |
dialogTitle = title; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
59 |
dialogHintText = hintText; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
60 |
defaultValue = defaultVal; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
61 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
62 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
63 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
64 |
* Checks that user entered text does not contain illegal/unwanted |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
65 |
* characters. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
66 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
67 |
* @param line |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
68 |
* User entered text |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
69 |
* @return True if user entered text does not contain illegal characters |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
70 |
* otherwise False |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
71 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
72 |
public boolean checkCharacters(final String line) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
73 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
74 |
CharSequence[] charTable = { "&", "^", "+", "-", "@", "$", "%", "*", |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
75 |
"(", ")", "|", "\\", "/", "[", "]", "{", "}", "<", ">", "?", |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
76 |
";", ":", ",", "\"", "'" }; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
77 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
78 |
// thru illegal/unwanted char table |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
79 |
for (int i = 0; i < charTable.length; i++) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
80 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
81 |
// if user entered text contains illegal/unwanted characters => |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
82 |
// return false |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
83 |
if (line.contains(charTable[i])) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
84 |
return false; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
85 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
86 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
87 |
return true; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
88 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
89 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
90 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
91 |
* Gets self instance. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
92 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
93 |
* @return Self instance |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
94 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
95 |
public final CustomInputDialog getParent() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
96 |
return this; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
97 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
98 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
99 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
100 |
* Returns user input. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
101 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
102 |
* @return User input |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
103 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
104 |
public final String getUserInput() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
105 |
return input; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
106 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
107 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
108 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
109 |
* Checks is user given input valid for the AnalyzeTool. If input contains |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
110 |
* space/illegal character(s) or it contains more than 50 characters the OK |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
111 |
* button becomes disabled and corresponding error message is displayed. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
112 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
113 |
* @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String) |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
114 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
115 |
* @param newText |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
116 |
* User input |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
117 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
118 |
* @return String Error message if the user given input is invalid otherwise |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
119 |
* empty string |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
120 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
121 |
public final String isValid(final String newText) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
122 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
123 |
CharSequence space = " "; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
124 |
if (("").equals(newText)) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
125 |
return (""); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
126 |
} else if (newText.contains(space)) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
127 |
return (Constants.INPUT_NO_SPACES_ALLOWED); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
128 |
} else if (newText.length() > Constants.MAX_LENGTH_OF_USER_INPUT) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
129 |
return (Constants.INPUT_TOO_LONG); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
130 |
} else if (!checkCharacters(newText)) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
131 |
return (Constants.INPUT_ILLEGAL); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
132 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
133 |
return null; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
134 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
135 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
136 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
137 |
* Opens dialog |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
138 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
139 |
public final void open() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
140 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
141 |
Activator.getDefault().getWorkbench().getDisplay().syncExec( |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
142 |
new Runnable() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
143 |
public void run() { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
144 |
InputDialog dlg = new InputDialog(Activator |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
145 |
.getDefault().getWorkbench().getDisplay() |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
146 |
.getActiveShell(), dialogTitle, dialogHintText, |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
147 |
defaultValue, getParent()); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
148 |
if (dlg.open() == Window.OK) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
149 |
input = dlg.getValue(); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
150 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
151 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
152 |
}); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
153 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
154 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
155 |
} |