Re: Use MultiView APIs

Nuwan Sameera <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAN=6b0jp0H0W6J6i8-A+nHdqZoGyR=Wzte-s2keNk1BBNP8Pzg@mail.gmail.com>
Hi,

Thank you. My source codes available in [1]

[1]
https://github.com/NuwanSameera/syncope/blob/master/netbeans-plugin/src/main/java/org/apache/syncope/netbeans/plugin/view/ResourceExplorerTopComponent.java

Line 479 - 581

Please check and support to solve issue.

I need to open empty editor and editor with content.

Regards,
Nuwan Sameera.


On Thu, Jul 14, 2016 at 11:27 PM, geertjan wielenga <
[email protected]> wrote:

>
> Is the source code on GitHub or somewhere like that? Would be happy to
> help you, but need more context than the below, i.e., ideally the full
> source code.
>
> Gj
>
>
> On 14-7-2016 19:30, Nuwan Sameera wrote:
>
> Hi all,
>
> I am developing netbeans plugin for apache syncope. I need to open editors
> in different tabs in same instance like SOURCE and HISTORY. I am tried to
> using following code.
>
> MultiViewDescription[] descriptionArray = new MultiViewDescription[0];
> descriptionArray[0] = new MultiViewDescription() {
>             @Override
>             public int getPersistenceType() {
>                 return 0;
>             }
>
>             @Override
>             public String getDisplayName() {
>                 return "Test 1";
>             }
>
>             @Override
>             public Image getIcon() {
>                 return null;
>             }
>
>             @Override
>             public HelpCtx getHelpCtx() {
>                 return null;
>             }
>
>             @Override
>             public String preferredID() {
>                 return "A";
>             }
>
>             @Override
>             public MultiViewElement createElement() {
>                 return new MultiViewEditorElement(Lookup.EMPTY);
> *//GIVEN RUNTIME ERROR *
>             }
> };
>
> TopComponent ctc = MultiViewFactory.createMultiView(descriptionArray,
> descriptionArray[0]);
> ctc.open();
> ctc.requestActive();
>
> *//GIVEN RUNTIME ERROR Line give *IllegalArgumentException
> <http://download.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true>
> saying CloneableEditorSupport
> <http://bits.netbeans.org/8.0/javadoc/org-openide-text/org/openide/text/CloneableEditorSupport.html?is-external=true>
> is not present in provided Lookup
> <http://bits.netbeans.org/8.0/javadoc/org-openide-util/org/openide/util/Lookup.html?is-external=true>
> .
>
> I search method to create Lookup object with ClonableEditorSupport. I
> don't found suitable solution.
>
> Please help me.
>
> Thanks and Regards.
> --
> Nuwan Sameera.
> Undergraduate,
> Electronic and Telecommunication Engineering,
> University of Moratuwa.
>
>
>


-- 
Nuwan Sameera.
Undergraduate,
Electronic and Telecommunication Engineering,
University of Moratuwa.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.