-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Hint Feature (other updates come later)
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<wodefinitions> | ||
<wo class="ERD2WDisplayHint" wocomponentcontent="false"> <binding name="d2wContext"/> | ||
<validation message="'d2wContext' is a required binding."> | ||
<unbound name="d2wContext"/> | ||
</validation> | ||
</wo> | ||
</wodefinitions> |
5 changes: 5 additions & 0 deletions
5
...ks/Core/ERDirectToWeb/Components/Nonlocalized.lproj/ERDDisplayHint.wo/ERDDisplayHint.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<webobject name="CanDisplay"> | ||
<webobject name="HasHint"> | ||
<span class="ERD2WHint"> <webobject name="VALUE" /></span> | ||
</webobject> | ||
</webobject> |
11 changes: 11 additions & 0 deletions
11
...rks/Core/ERDirectToWeb/Components/Nonlocalized.lproj/ERDDisplayHint.wo/ERDDisplayHint.wod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CanDisplay : WOConditional { | ||
condition = displayHint; | ||
} | ||
|
||
HasHint : WOConditional { | ||
condition = ^d2wContext.hint; | ||
} | ||
|
||
VALUE : ERXLocalizedString { | ||
value = ^d2wContext.hint; | ||
} |
4 changes: 4 additions & 0 deletions
4
...rks/Core/ERDirectToWeb/Components/Nonlocalized.lproj/ERDDisplayHint.wo/ERDDisplayHint.woo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"WebObjects Release" = "WebObjects 5.0"; | ||
encoding = "UTF-8"; | ||
} |
42 changes: 42 additions & 0 deletions
42
Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/components/ERDDisplayHint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package er.directtoweb.components; | ||
|
||
import com.webobjects.appserver.WOContext; | ||
import com.webobjects.directtoweb.D2WContext; | ||
|
||
/** | ||
* <span class="ja"> | ||
* このコンポーネントは項目のヒントを表示します。 | ||
* | ||
* ルール又はユーザ・ディクショナリーで hint を指定します。 | ||
* | ||
* そうすると項目の右側にメッセージが表示されます。 | ||
* ただし、"inspect" と "edit" タスク時のみで表示される | ||
* | ||
* @d2wKey hint - 表示するヒント | ||
* </span> | ||
* | ||
* @author ishimoto | ||
*/ | ||
public class ERDDisplayHint extends ERD2WStatelessComponent { | ||
/** | ||
* Do I need to update serialVersionUID? | ||
* See section 5.6 <cite>Type Changes Affecting Serialization</cite> on page 51 of the | ||
* <a href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf">Java Object Serialization Spec</a> | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public ERDDisplayHint(WOContext aContext) { | ||
super(aContext); | ||
} | ||
|
||
public boolean displayHint() { | ||
D2WContext d2w = (D2WContext) valueForBinding("d2wContext"); | ||
String task = d2w.task(); | ||
|
||
if("inspect".equals(task) || "edit".equals(task)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
} |