NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Revivius
Joined: 27 Apr 2011 Posts: 8 Location: Turkey
|
Posted: Wed May 09, 2012 9:35 pm Post subject: Registering a default MultiViewElement using sth like "application/*" |
|
|
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.
|
Posted: Wed May 09, 2012 10:08 pm Post subject: Re: Registering a default MultiViewElement using sth like "application/*" |
|
|
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 |
|
 |
|
|
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
|
|