NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Registering a default MultiViewElement using sth like "application/*"

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers
View previous topic :: View next topic  
Author Message
Revivius



Joined: 27 Apr 2011
Posts: 8
Location: Turkey

PostPosted: Wed May 09, 2012 9:35 pm    Post subject: Registering a default MultiViewElement using sth like "application/*" Reply with quote

Hi;

First of all, I posted same question to Platfrom Users Forum, no reply. So is this the correct place for it ? If not, I can delete the topic. Here is my question:

Is it possible to register a default MultiViewElement using a mime type like "application/*" ?

I am faking my model objects (provided from node lookup) as if they have a mime type.

Code:
public class SomeModelObject implements Serializable {
    public String getMime() {
        return mime;
    }
}


to return mime types similar to

Code:
public static final String[] MIME_TYPES = {
        "application/type1",
        "application/type2",
        "application/type3",
        "application/type4"
   };


Now when creating MultiViewTopComponent to edit/display those objects I want my editor to have a default view + registered multiview element(s) for that specific mime type.

Code:
TopComponent tc = MultiViews.createMultiView(modelObject.getMime(), node);
tc.open();


I tried following with no success.

@MultiViewElement.Registration(displayName = "Default",
iconBase = <icon_base>,
mimeType = "application/*",
persistenceType = TopComponent.PERSISTENCE_NEVER,
preferredID = <id>,
position = <position>)

I feel like there is an easy way to do this apperantly i am missing.

Thank you.
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Wed May 09, 2012 10:08 pm    Post subject: Re: Registering a default MultiViewElement using sth like "application/*" Reply with quote

On 05/09/2012 11:36 PM, Revivius wrote:
Quote:
Hi;

First of all, I posted same question to Platfrom Users Forum, no reply.

The other place is the right place for it. Maybe no one knows the
answer. Anyway, don't expect a response to a question to always happen
within 24 hours. Normally, that happens, but it's not a rule. Give it a
bit of time.

Gj
Quote:
So is this the correct place for it ? If not, I can delete the topic. Here is my question:

Is it possible to register a default MultiViewElement using a mime type like "application/*" ?

I am faking my model objects (provided from node lookup) as if they have a mime type.


Code:
public class SomeModelObject implements Serializable {
public String getMime() {
return mime;
}
}



to return mime types similar to


Code:
public static final String[] MIME_TYPES = {
"application/type1",
"application/type2",
"application/type3",
"application/type4"
};



Now when creating MultiViewTopComponent to edit/display those objects I want my editor to have a default view + registered multiview element(s) for that specific mime type.


Code:
TopComponent tc = MultiViews.createMultiView(modelObject.getMime(), node);
tc.open();



I tried following with no success.

@MultiViewElement.Registration(displayName = "Default",
iconBase =<icon_base>,
mimeType = "application/*",
persistenceType = TopComponent.PERSISTENCE_NEVER,
preferredID =<id>,
position =<position>)

I feel like there is an easy way to do this apperantly i am missing.

Thank you.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Developers All times are GMT
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo