OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[JAVA] how to insert additional info for objects? metadata?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
poekel
General User
General User


Joined: 14 Jun 2004
Posts: 8
Location: Germany

PostPosted: Mon Jul 05, 2004 6:30 am    Post subject: [JAVA] how to insert additional info for objects? metadata? Reply with quote

hej,

is there a way to insert additional data - e.g. metadata - to objects, graphics etc.? this should work like this:
- select a graphic image
- go to a menu entry and add a note to this object
- the note should be hidden and only attached to the selected object

anyone knows?
thanks a lot
poekel
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Jul 06, 2004 8:04 am    Post subject: Reply with quote

I just wrote this Code Snippets article to show how to add custom attributes to a shape.

Custom Attributes on Shapes (Draw or Writer)
http://www.oooforum.org/forum/viewtopic.php?t=10527

Note the example is in OOo Basic.

What you want to do sounds very similar to what I want to do. A dialog box that modifies the selected shape, or creates a new shape based on the currently selected text.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
poekel
General User
General User


Joined: 14 Jun 2004
Posts: 8
Location: Germany

PostPosted: Wed Jul 07, 2004 5:38 am    Post subject: Reply with quote

oh thanks,

but i don't know how to use this in a text document. here some further examples of my code...i successfully determine that a graphic is selected:

Code:
XController xFramecontroller = m_xFrame.getController();
XSelectionSupplier xselectionsupplier = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xFramecontroller);
Object objectSelection = xselectionsupplier.getSelection();
XServiceInfo xserviceinfo = ( XServiceInfo ) UnoRuntime.queryInterface(XServiceInfo.class, objectSelection );

if ( xserviceinfo.supportsService("com.sun.star.text.TextGraphicObject" )) {
    // now i can access all properties of the textGraphicObject service
    props = UnoRuntime.queryInterface(XPropertySet.class, objectSelection);
    // ...so i can invert the selected graphic
    props.setPropertyValue("GraphicIsInverted", new Boolean(true));
}

but now my problem is to attach additional content - user defined attributes or something else - to this object...
what can i do?

greetz
dennis
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group