You are not logged in.

spodhajecki

Beginner

  • "spodhajecki" started this thread

Posts: 6

Date of registration: Dec 3rd 2010

Occupation: IT Specialist

Hobbies: Woodworking, Welding, Biking.

  • Send private message

1

Friday, December 3rd 2010, 8:11pm

Tree Node Key

How does one get the "Key" value from a tree node? Although Key, a String value, is passed in when adding the node, Key does not appear in the node property list.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Friday, December 3rd 2010, 8:48pm

The "key" is just used to be able to access the node items by key searching the Nodes collection.
If you would like to retrieve the key for a given node, you'd have to remember the node/key pairs in a separate collection.

To my knowlegde, it is generally the case that collection keys are just used for access.
You can't retrieve the key from a collection item unless you have explicitely stored it somewhere beforehand.

Does this makes sense to you?

Greetings

A1880

spodhajecki

Beginner

  • "spodhajecki" started this thread

Posts: 6

Date of registration: Dec 3rd 2010

Occupation: IT Specialist

Hobbies: Woodworking, Welding, Biking.

  • Send private message

3

Friday, December 3rd 2010, 9:31pm

Yes, I was hoping to avoid caching nodes and keys in a table.

I was hoping to click on a node (which is displaying a Name), retrieve the Key value, retrieve a record set from an SQLite DB based on the Key value. The Key value that is set for each node is a unique ID from the database.

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

4

Saturday, December 4th 2010, 11:14am

The Microsoft data model in VB6 is more convenient here.
A "Node" has a "Text", a "Key" and a "Tag" property.
Ample opportunities to store DB keys.

The same level of flexibility can be achieved in Jabaco by extending the Jabaco Framework.
"Somebody" has to rework the classes "Nodes" and "Node".
Volunteers wanted!

Greetings

A1880

spodhajecki

Beginner

  • "spodhajecki" started this thread

Posts: 6

Date of registration: Dec 3rd 2010

Occupation: IT Specialist

Hobbies: Woodworking, Welding, Biking.

  • Send private message

5

Tuesday, December 7th 2010, 12:28am

Thanks for your attention, it is much appreciated.

Until such time as the framework can be updated, I used java#util#hashmap to store the node and key.

I noticed that the framework jars of late on the framework page are significantly smaller than previous versions. Are they complete?

This post has been edited 1 times, last edit by "spodhajecki" (Dec 7th 2010, 3:19am)


A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

6

Tuesday, December 7th 2010, 11:16am

No, the small versions tend to be incomplete.

You can find out by renaming the *.jar to *.zip.
Then you can use Windows Explorer or any archiving tool to inspect the file contents.

Greetings

A1880

spodhajecki

Beginner

  • "spodhajecki" started this thread

Posts: 6

Date of registration: Dec 3rd 2010

Occupation: IT Specialist

Hobbies: Woodworking, Welding, Biking.

  • Send private message

7

Wednesday, December 8th 2010, 7:33am

I downloaded the source form svn and modified Nodes.jsrc and Node.jsrc adding a property get for Key. I also added a Tag property of type Variant.

So now, one can get the Key value with but there is not a property Let because the Key value is
used with a "Collection" as part of the original code in Nodes.jsrc.

Jabaco Source

1
2
Dim theKey as String
theKey = Node.Key



The node Tag property can use both Let or Get and works similar to VB6 where the tag property has to be explicitly set.

Jabaco Source

1
Node.Tag = "My Tag"


It was a chore to compile the framework. The build.xml file needed to be modified to fix the paths. Then, the Jabaco VB framework build failed because its dependent on the VBA class files just compiled. The build.xml file had to modified again by commenting out the following line under target "build".

Source code

1
<delete dir="${build.dir}" />
When the ant script finishes, it erases the java class files. So commenting the line prevents that for the next step. The VB folder from the original Jabaco.jar was extracted to the bin-tmp folder and a new jar was created (from the command line)

Source code

1
jar -cvf ./bin/Jabaco.jar -C bin-tmp .
which was copied to the Jabaco IDE dir. Build.bat was run again, the Jabaco VB source files compiled and the Jabaco.jar file was created in the bin dir. 8|

I can post the code of the modified files if someone wishes.

Regards,
Stephen

spodhajecki

Beginner

  • "spodhajecki" started this thread

Posts: 6

Date of registration: Dec 3rd 2010

Occupation: IT Specialist

Hobbies: Woodworking, Welding, Biking.

  • Send private message

8

Wednesday, December 8th 2010, 7:38am

You can find out by renaming the *.jar to *.zip.
Then you can use Windows Explorer or any archiving tool to inspect the file contents.
For those interested, IZarc will open the jar files without having to change the extension.

aawaad

Beginner

Posts: 9

Date of registration: Jul 7th 2009

  • Send private message

9

Thursday, November 10th 2011, 3:40am

Tree Node Key

Hi

I wish to have the code for extending the tree node & nodes, I need to use the key & tag.

Thanks,

Ashraf

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

10

Thursday, November 10th 2011, 5:03pm

RE: Tree Node Key

I wish to have the code for extending the tree node & nodes, I need to use the key & tag.


Do you mean the code of Node.jsrc and Nodes.jsrc?

Node.jsrc
Nodes.jsrc

All files you can find at
http://code.google.com/p/jabacoframework…work%2Fsrc%2FVB

To download the complete source as compressed zip-file:
jabacoframework-src-rev84.zip

Greatings
theuserbl

aawaad

Beginner

Posts: 9

Date of registration: Jul 7th 2009

  • Send private message

11

Friday, November 11th 2011, 4:19pm

code for property Get for the Key and Tag

I mean the added code for getting the Node Key and Tag not the original jrsc files

I guess the code in Nodes should be like myNode.Key=Key in the Add function.

In Node file how to add property Get Key()?

Thanks,

aawaad

Beginner

Posts: 9

Date of registration: Jul 7th 2009

  • Send private message

12

Thursday, November 17th 2011, 12:47am

Dears,

Can you elaborate more on compiling the Jabaco code, I added the code but couldn't get the newly added Key to appear.

BR

Ashraf

Rate this thread
WoltLab Burning Board