Re: MultiView using the mavenized module project

2020-06-28 Thread John Kostaras
Old tutorials mention extensions as e.g. .abc .ABC instead of abc ABC!
Newer tutorials like this one
 are correct. :)

When you create Additional Multiview Windows as described in the above
tutorial, how do you display the *Source* editor pane in the second
MultiView element like the *Source* tab does?

More precisely, AbcVisualElement displays the Source view. AbcVisualPanel
displays the Visual view. AbcVisualElement2 displays nothing. It could e.g.
display a JSplitPane displaying both the source and visual views at the
same time, but how do you make it display the same view on the left side of
the JSplitPane that the Source view displays? As well as the toolbar, the
same actions etc.?

AbcVisualElement2.getVisualRepresentation() returns this. Shouldn't it
return a panel (with a split pane)? But then you need to pass it a
reference to the JEditorPane of the Source view or something. But how do
you get access to this JEditorPane (aJTextComponent)?

public JComponent getVisualRepresentation() {
return new AbcSourceVisualPanel(aJTextComponent); // what do I pass here?
}

Trying ViewerDataObject.createEditor(lookup); that returns a
MultiViewEditorElement from which one can call getEditorPane() returns null.

SideBars as described by Geertjan here

and here
do
provide a

JComponent createSideBar(JTextComponent editor)

to do the job where JTextComponent is provided by the platform.
Unfortunately, SideBars don't offer a splitter that the user can drag to
change the sides of the two views.

If not clear I could provide a more concrete example.

Thank you in advance.

John.

On Mon, 18 May 2020 at 21:51, Tim Boudreau  wrote:

> Any chance your module with the file type is configured to be an
> *autoload* module?
> If so, the jar may not be opened until something that depends on it
> requires it, so your loader won't be registered.
>
> -Tim
>
> On Sun, May 17, 2020 at 4:56 PM John Kostaras  wrote:
>
> > Hallo,
> >
> > I wonder if anybody has tried to create to create a new File Type using
> the
> > mavenized module project. Let me be more specific.
> >
> >- NetBeans 11.3
> >- Follow this tutorial
> > to
> > create
> >a new File type, but instead of creating a "Java with Ant -> NetBeans
> >Modules -> Module" to create a NB module, use a "Java with Maven ->
> >NetBeans Module" NB module.
> >- If you follow the steps of the tutorial using the Ant NB module,
> >everything runs fine and you can open the file with the defined
> > extension
> >in a MultiView seeing both Source and Visual buttons (and History)
> >- If you follow the tutorial's steps using the Maven NB module, then
> the
> >file type registration seems to not be successful; when you open a
> file
> >with the defined extension the MultiView only shows the Source (and
> >History) button(s), i.e. no Visual and if you open the Properties
> > window it
> >says that the file type is not recognized.
> >   - Steps are:
> >  1. New > Other > Module Development > File Type, which
> > creates the *DataObject.java,
> >  VisualElement.java *and the *Template *file.
> >
> >
> >1. Is it a bug or am I 'm doing something wrong?
> >2. There seems to not be a lot of tutorials around; I would appreciate
> >if you could point me to a better one than the one I mention, or I
> could
> >write an updated tutorial (if it works and I have done something
> wrong)
> >
> > Thank you in advance for the prompt reply.
> >
> > John.
> >
>
>
> --
> http://timboudreau.com
>


Re: MultiView using the mavenized module project

2020-05-18 Thread Tim Boudreau
Any chance your module with the file type is configured to be an
*autoload* module?
If so, the jar may not be opened until something that depends on it
requires it, so your loader won't be registered.

-Tim

On Sun, May 17, 2020 at 4:56 PM John Kostaras  wrote:

> Hallo,
>
> I wonder if anybody has tried to create to create a new File Type using the
> mavenized module project. Let me be more specific.
>
>- NetBeans 11.3
>- Follow this tutorial
> to
> create
>a new File type, but instead of creating a "Java with Ant -> NetBeans
>Modules -> Module" to create a NB module, use a "Java with Maven ->
>NetBeans Module" NB module.
>- If you follow the steps of the tutorial using the Ant NB module,
>everything runs fine and you can open the file with the defined
> extension
>in a MultiView seeing both Source and Visual buttons (and History)
>- If you follow the tutorial's steps using the Maven NB module, then the
>file type registration seems to not be successful; when you open a file
>with the defined extension the MultiView only shows the Source (and
>History) button(s), i.e. no Visual and if you open the Properties
> window it
>says that the file type is not recognized.
>   - Steps are:
>  1. New > Other > Module Development > File Type, which
> creates the *DataObject.java,
>  VisualElement.java *and the *Template *file.
>
>
>1. Is it a bug or am I 'm doing something wrong?
>2. There seems to not be a lot of tutorials around; I would appreciate
>if you could point me to a better one than the one I mention, or I could
>write an updated tutorial (if it works and I have done something wrong)
>
> Thank you in advance for the prompt reply.
>
> John.
>


-- 
http://timboudreau.com


Re: MultiView using the mavenized module project

2020-05-18 Thread Mario Schroeder
John, I can not remember having any issues while I wrote the tutorial for
the book. I used Maven there.

John Kostaras  schrieb am So., 17. Mai 2020, 22:56:

> Hallo,
>
> I wonder if anybody has tried to create to create a new File Type using the
> mavenized module project. Let me be more specific.
>
>- NetBeans 11.3
>- Follow this tutorial
> to
> create
>a new File type, but instead of creating a "Java with Ant -> NetBeans
>Modules -> Module" to create a NB module, use a "Java with Maven ->
>NetBeans Module" NB module.
>- If you follow the steps of the tutorial using the Ant NB module,
>everything runs fine and you can open the file with the defined
> extension
>in a MultiView seeing both Source and Visual buttons (and History)
>- If you follow the tutorial's steps using the Maven NB module, then the
>file type registration seems to not be successful; when you open a file
>with the defined extension the MultiView only shows the Source (and
>History) button(s), i.e. no Visual and if you open the Properties
> window it
>says that the file type is not recognized.
>   - Steps are:
>  1. New > Other > Module Development > File Type, which
> creates the *DataObject.java,
>  VisualElement.java *and the *Template *file.
>
>
>1. Is it a bug or am I 'm doing something wrong?
>2. There seems to not be a lot of tutorials around; I would appreciate
>if you could point me to a better one than the one I mention, or I could
>write an updated tutorial (if it works and I have done something wrong)
>
> Thank you in advance for the prompt reply.
>
> John.
>


MultiView using the mavenized module project

2020-05-17 Thread John Kostaras
Hallo,

I wonder if anybody has tried to create to create a new File Type using the
mavenized module project. Let me be more specific.

   - NetBeans 11.3
   - Follow this tutorial
    to create
   a new File type, but instead of creating a "Java with Ant -> NetBeans
   Modules -> Module" to create a NB module, use a "Java with Maven ->
   NetBeans Module" NB module.
   - If you follow the steps of the tutorial using the Ant NB module,
   everything runs fine and you can open the file with the defined extension
   in a MultiView seeing both Source and Visual buttons (and History)
   - If you follow the tutorial's steps using the Maven NB module, then the
   file type registration seems to not be successful; when you open a file
   with the defined extension the MultiView only shows the Source (and
   History) button(s), i.e. no Visual and if you open the Properties window it
   says that the file type is not recognized.
  - Steps are:
 1. New > Other > Module Development > File Type, which
creates the *DataObject.java,
 VisualElement.java *and the *Template *file.


   1. Is it a bug or am I 'm doing something wrong?
   2. There seems to not be a lot of tutorials around; I would appreciate
   if you could point me to a better one than the one I mention, or I could
   write an updated tutorial (if it works and I have done something wrong)

Thank you in advance for the prompt reply.

John.