[nbcustomermanager~subversion:5] adding a context sensitive action and updating to 6.9
- From: GWiel@kenai.com
- To: commits@nbcustomermanager.kenai.com
- Subject: [nbcustomermanager~subversion:5] adding a context sensitive action and updating to 6.9
- Date: Thu, 25 Mar 2010 16:19:40 +0000
Project: nbcustomermanager
Repository: subversion
Revision: 5
Author: GWiel
Date: 2010-03-25 16:19:38 UTC
Link:
Log Message:
------------
adding a context sensitive action and updating to 6.9
Revisions:
----------
5
Modified Paths:
---------------
DBManager/CustomerEditor/nbproject/genfiles.properties
DBManager/CustomerViewer/src/org/shop/ui/CustomerChildFactory.java
DBManager/CustomerViewer/src/org/shop/ui/Bundle.properties
DBManager/CustomerEditor/nbproject
DBManager/CustomerEditor/nbproject/project.xml
DBManager/nbproject/build-impl.xml
DBManager/nbproject/genfiles.properties
DBManager/CustomerViewer/nbproject/genfiles.properties
DBManager/CustomerViewer/nbproject/project.xml
DBManager/CustomerViewer/src/org/shop/ui/layer.xml
Added Paths:
------------
DBManager/CustomerViewer/src/org/shop/ui/customer.png
DBManager/CustomerViewer/src/org/shop/ui/customer24.png
DBManager/CustomerViewer/src/org/shop/ui/CustomerDetailsAction.java
Diffs:
------
Index: DBManager/CustomerViewer/nbproject/project.xml
===================================================================
--- DBManager/CustomerViewer/nbproject/project.xml (revision 4)
+++ DBManager/CustomerViewer/nbproject/project.xml (revision 5)
@@ -57,6 +57,14 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.openide.util.lookup</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>8.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.openide.windows</code-name-base>
<build-prerequisite/>
<compile-dependency/>
Index: DBManager/CustomerViewer/nbproject/genfiles.properties
===================================================================
--- DBManager/CustomerViewer/nbproject/genfiles.properties (revision 4)
+++ DBManager/CustomerViewer/nbproject/genfiles.properties (revision 5)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=3a51dd9a
+build.xml.data.CRC32=0e5797b5
build.xml.script.CRC32=eee3db7d
-build.xml.stylesheet.CRC32=79c3b980@1.31.1.7
+build.xml.stylesheet.CRC32=79c3b980@1.40
# This file is used by a NetBeans-based IDE to track changes in generated
files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never
regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=3a51dd9a
+nbproject/build-impl.xml.data.CRC32=0e5797b5
nbproject/build-impl.xml.script.CRC32=706490e5
-nbproject/build-impl.xml.stylesheet.CRC32=261c4bef@1.31.1.7
+nbproject/build-impl.xml.stylesheet.CRC32=261c4bef@1.40
Index: DBManager/CustomerViewer/src/org/shop/ui/Bundle.properties
===================================================================
--- DBManager/CustomerViewer/src/org/shop/ui/Bundle.properties (revision 4)
+++ DBManager/CustomerViewer/src/org/shop/ui/Bundle.properties (revision 5)
@@ -1,4 +1,5 @@
CTL_CustomerAction=Customer
+CTL_CustomerDetailsAction=Customer Details
CTL_CustomerTopComponent=Customer Window
HINT_CustomerTopComponent=This is a Customer window
OpenIDE-Module-Name=CustomerViewer
Index: DBManager/CustomerViewer/src/org/shop/ui/customer.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: DBManager/CustomerViewer/src/org/shop/ui/customer.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: DBManager/CustomerViewer/src/org/shop/ui/CustomerDetailsAction.java
===================================================================
--- DBManager/CustomerViewer/src/org/shop/ui/CustomerDetailsAction.java
(revision 0)
+++ DBManager/CustomerViewer/src/org/shop/ui/CustomerDetailsAction.java
(revision 5)
@@ -0,0 +1,22 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.shop.ui;
+
+import demo.Customer;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+public final class CustomerDetailsAction implements ActionListener {
+
+ private final Customer context;
+
+ public CustomerDetailsAction(Customer context) {
+ this.context = context;
+ }
+
+ public void actionPerformed(ActionEvent ev) {
+ // TODO use context
+ }
+}
Index: DBManager/CustomerViewer/src/org/shop/ui/customer24.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: DBManager/CustomerViewer/src/org/shop/ui/customer24.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: DBManager/CustomerViewer/src/org/shop/ui/layer.xml
===================================================================
--- DBManager/CustomerViewer/src/org/shop/ui/layer.xml (revision 4)
+++ DBManager/CustomerViewer/src/org/shop/ui/layer.xml (revision 5)
@@ -1,22 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN"
"http://www.netbeans.org/dtds/filesystem-1_2.dtd">
<filesystem>
- <folder name="Actions">
- <folder name="Window">
- <file name="org-shop-ui-CustomerAction.instance">
- <attr name="component"
methodvalue="org.shop.ui.CustomerTopComponent.findInstance"/>
- <attr name="displayName"
bundlevalue="org.shop.ui.Bundle#CTL_CustomerAction"/>
- <attr name="instanceCreate"
methodvalue="org.openide.windows.TopComponent.openAction"/>
- </file>
- </folder>
+<folder name="Actions">
+ <folder name="Build">
+ <file name="org-shop-ui-CustomerDetailsAction.instance">
+ <attr name="delegate"
methodvalue="org.openide.awt.Actions.inject"/>
+ <attr name="displayName"
bundlevalue="org.shop.ui.Bundle#CTL_CustomerDetailsAction"/>
+ <attr name="iconBase" stringvalue="org/shop/ui/customer.png"/>
+ <attr name="injectable"
stringvalue="org.shop.ui.CustomerDetailsAction"/>
+ <attr name="instanceCreate"
methodvalue="org.openide.awt.Actions.context"/>
+ <attr name="noIconInMenu" boolvalue="false"/>
+ <attr name="selectionType" stringvalue="EXACTLY_ONE"/>
+ <attr name="type" stringvalue="demo.Customer"/>
+ </file>
</folder>
- <folder name="Menu">
- <folder name="Window">
- <file name="CustomerAction.shadow">
- <attr name="originalFile"
stringvalue="Actions/Window/org-shop-ui-CustomerAction.instance"/>
- </file>
- </folder>
+</folder>
+<folder name="Menu">
+ <folder name="File">
+ <file name="org-shop-ui-CustomerDetailsAction.shadow">
+ <attr name="originalFile"
stringvalue="Actions/Build/org-shop-ui-CustomerDetailsAction.instance"/>
+ <attr name="position" intvalue="1300"/>
+ </file>
</folder>
+</folder>
+<folder name="Toolbars">
+ <folder name="File">
+ <attr
name="org-shop-ui-CustomerDetailsAction.shadow/org-openide-actions-SaveAllAction.shadow_hidden"
boolvalue="true"/>
+ <file name="org-shop-ui-CustomerDetailsAction.shadow">
+ <attr name="originalFile"
stringvalue="Actions/Build/org-shop-ui-CustomerDetailsAction.instance"/>
+ </file>
+ </folder>
+</folder>
<folder name="Windows2">
<folder name="Components">
<file name="CustomerTopComponent.settings"
url="CustomerTopComponentSettings.xml"/>
Index: DBManager/CustomerViewer/src/org/shop/ui/CustomerChildFactory.java
===================================================================
--- DBManager/CustomerViewer/src/org/shop/ui/CustomerChildFactory.java
(revision 4)
+++ DBManager/CustomerViewer/src/org/shop/ui/CustomerChildFactory.java
(revision 5)
@@ -2,10 +2,12 @@
import demo.Customer;
import java.util.List;
+import javax.swing.Action;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
+import org.openide.util.Utilities;
import org.openide.util.lookup.Lookups;
public class CustomerChildFactory extends ChildFactory<Customer> {
@@ -24,17 +26,30 @@
return true;
}
-@Override
-protected Node createNodeForKey(Customer c) {
- Node node = new AbstractNode(Children.LEAF, Lookups.singleton(c));
- node.setDisplayName(c.getName());
- node.setShortDescription(c.getCity());
- return node;
-// try {
-// return new BeanNode(c);
-// } catch (IntrospectionException ex) {
-// Exceptions.printStackTrace(ex);
-// return null;
-// }
+ @Override
+ protected Node createNodeForKey(Customer c) {
+ return new CustomerNode(c);
+// Node node = new AbstractNode(Children.LEAF, Lookups.singleton(c));
+// node.setDisplayName(c.getName());
+// node.setShortDescription(c.getCity());
+// return node;
+ }
+
+ private class CustomerNode extends AbstractNode {
+
+ public CustomerNode(Customer c) {
+ super(Children.LEAF, Lookups.singleton(c));
+ setDisplayName(c.getName());
+ setShortDescription(c.getCity());
+ }
+
+ @Override
+ public Action[] getActions(boolean context) {
+ return new Action[]{
+ Utilities.actionsForPath("Actions/Build/").get(0),
+ Utilities.actionsForPath("Actions/Build/").get(1),};
+ }
+
+ }
+
}
-}
Index: DBManager/nbproject/genfiles.properties
===================================================================
--- DBManager/nbproject/genfiles.properties (revision 4)
+++ DBManager/nbproject/genfiles.properties (revision 5)
@@ -4,5 +4,5 @@
# This file is used by a NetBeans-based IDE to track changes in generated
files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never
regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=671a6e6f
-nbproject/build-impl.xml.script.CRC32=1e40d166
-nbproject/build-impl.xml.stylesheet.CRC32=2f5f2db8@1.31.1.7
+nbproject/build-impl.xml.script.CRC32=8d99e385
+nbproject/build-impl.xml.stylesheet.CRC32=56de960a@1.40
Index: DBManager/nbproject/build-impl.xml
===================================================================
--- DBManager/nbproject/build-impl.xml (revision 4)
+++ DBManager/nbproject/build-impl.xml (revision 5)
@@ -38,5 +38,12 @@
</not>
</condition>
</fail>
+ <fail message="Cannot find NetBeans build harness.
${line.separator}Check that nbplatform.${nbplatform.active}.netbeans.dest.dir
and nbplatform.${nbplatform.active}.harness.dir are defined.
${line.separator}On a developer machine these are normally defined in
${user.properties.file}=${netbeans.user}/build.properties
${line.separator}but for automated builds you should pass these properties to
Ant explicitly.">
+ <condition>
+ <not>
+ <available type="dir" file="${harness.dir}"/>
+ </not>
+ </condition>
+ </fail>
<import file="${harness.dir}/suite.xml"/>
</project>
Index: DBManager/CustomerEditor/nbproject/project.xml
===================================================================
--- DBManager/CustomerEditor/nbproject/project.xml (revision 4)
+++ DBManager/CustomerEditor/nbproject/project.xml (revision 5)
@@ -57,6 +57,14 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.openide.util.lookup</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <specification-version>8.2</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.openide.windows</code-name-base>
<build-prerequisite/>
<compile-dependency/>
Index: DBManager/CustomerEditor/nbproject/genfiles.properties
===================================================================
--- DBManager/CustomerEditor/nbproject/genfiles.properties (revision 4)
+++ DBManager/CustomerEditor/nbproject/genfiles.properties (revision 5)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=76d2fd84
+build.xml.data.CRC32=8502d694
build.xml.script.CRC32=54d9fb4b
-build.xml.stylesheet.CRC32=79c3b980@1.31.1.7
+build.xml.stylesheet.CRC32=79c3b980@1.40
# This file is used by a NetBeans-based IDE to track changes in generated
files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never
regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=76d2fd84
+nbproject/build-impl.xml.data.CRC32=8502d694
nbproject/build-impl.xml.script.CRC32=f5bfca61
-nbproject/build-impl.xml.stylesheet.CRC32=261c4bef@1.31.1.7
+nbproject/build-impl.xml.stylesheet.CRC32=261c4bef@1.40
Property changes on: DBManager/CustomerEditor/nbproject
___________________________________________________________________
Added: svn:ignore
+ private
|
[nbcustomermanager~subversion:5] adding a context sensitive action and updating to 6.9 |
GWiel | 03/25/2010 |





