Any comment is welcome to my topics in Eclipse Forum

classic Classic list List threaded Threaded
40 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
Hi,

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

I don't have answers to most of your questions, but I can try an answer on some of them:

> How to stop inserting same include stmt more than once

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

>  How to load a file content into a new editor tab

Look up the IDE class in Eclipse platform (such as openEditor method)

> How to use CDT to create a .h with a class decl?

Look how the new C++ class wizard is implemented for some clues.


I don't t

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com


On Wed, 4 Dec 2019 at 20:33, Ming Cheng <[hidden email]> wrote:
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Alexander Fedorov
Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 



_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
Hi,

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

Jonah

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com


On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 



_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

Yes, I run my Eclipse plugin (modified UMLet plugin) inside

 

Eclipse IDE for C/C++ Developers

 

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

Honestly speaking I am not sure whether UMLet Eclipse eventually will mix SWT and AWT, but I just added extra CDT jars and some Eclipse platform jars to UMLet plugin.  However one possible good symptom is that umlet-gwt failed to compile in my environment  while I can still get umlet-eclipse-plugin jar file. If my assumption that Eclipse platform jars and CDT jars do not use AWT is valid, then I should not mix SWT and AWT together. Since original UMLet Eclipse plugin works well for Eclipse, I’d like to assume they should have solved SWT AWT harmony issue well (?).

 

The following code run well although nothing happen eventually:

 

private void generateAClass(String classname)

{

            IWorkbench workbench = PlatformUI.getWorkbench();

            workbench.getDisplay().asyncExec(new Runnable() {

            public void run() {

                NewClassCreationWizard wizard = new NewClassCreationWizard();

                wizard.setClassName(fileName);

                wizard.addPages();

                wizard.performFinish();

            }

            });

                                       

             JOptionPane.showMessageDialog( null, classname );

}

 

 

But this code hangs again:

 

public class EclipseOpenFile /*extends SectionPart */{

    private static final Logger log = LoggerFactory.getLogger(DiagramFileHandler.class);

    public static void createClass(String location, String classname) {

        Path headerPath = new Path(location + "\\include\\" + classname + ".h");

        JOptionPane.showMessageDialog( null, headerPath.toString());

        Path sourcePath = new Path(location + "\\src\\"+ classname + ".cpp");

 

        IWorkbench workbench = PlatformUI.getWorkbench();

        workbench.getDisplay().asyncExec(new Runnable() {

                public void run() {

            NewClassCodeGenerator generator = new NewClassCodeGenerator(headerPath

                                                                    , sourcePath

                                                                    , null

                                                                    , classname

                                                                    , null, null, null);

            JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

            try {                                                      

                generator.createClass(new NullProgressMonitor()); 

                JOptionPane.showMessageDialog( null, "createClass");

            } catch (CoreException e) {

                JOptionPane.showMessageDialog( null, "CoreException");

            } catch (Exception e) {

                JOptionPane.showMessageDialog( null, "Exception");

            }

        }

        });

    }

 

The program did not come to:

JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

 

If I removed workbench.getDisplay().asyncExec(new Runnable() and have the rest directly under creatClass(), the result is the same.

 

Desperately need all of yours guide. Actual working code better.

 

Thanks.

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, December 16, 2019 11:02 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

 

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
Hi,

I am sorry I can't write any more code for you other than point you at the already written code available in CDT. As for mixing SWT/AWT I leave that up to you and the UMLet project - but you are correct, CDT does not use AWT. Have you tried stepping through the code that hangs, or pressing pause in the debugger to see what code it is stopped at? If you can provide either a stack trace of the hang, or if an exception is being thrown, then the stack trace of that would be helpful to diagnose the problem.

Jonah

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com


On Tue, 17 Dec 2019 at 04:10, Ming Cheng <[hidden email]> wrote:

Yes, I run my Eclipse plugin (modified UMLet plugin) inside

 

Eclipse IDE for C/C++ Developers

 

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

Honestly speaking I am not sure whether UMLet Eclipse eventually will mix SWT and AWT, but I just added extra CDT jars and some Eclipse platform jars to UMLet plugin.  However one possible good symptom is that umlet-gwt failed to compile in my environment  while I can still get umlet-eclipse-plugin jar file. If my assumption that Eclipse platform jars and CDT jars do not use AWT is valid, then I should not mix SWT and AWT together. Since original UMLet Eclipse plugin works well for Eclipse, I’d like to assume they should have solved SWT AWT harmony issue well (?).

 

The following code run well although nothing happen eventually:

 

private void generateAClass(String classname)

{

            IWorkbench workbench = PlatformUI.getWorkbench();

            workbench.getDisplay().asyncExec(new Runnable() {

            public void run() {

                NewClassCreationWizard wizard = new NewClassCreationWizard();

                wizard.setClassName(fileName);

                wizard.addPages();

                wizard.performFinish();

            }

            });

                                       

             JOptionPane.showMessageDialog( null, classname );

}

 

 

But this code hangs again:

 

public class EclipseOpenFile /*extends SectionPart */{

    private static final Logger log = LoggerFactory.getLogger(DiagramFileHandler.class);

    public static void createClass(String location, String classname) {

        Path headerPath = new Path(location + "\\include\\" + classname + ".h");

        JOptionPane.showMessageDialog( null, headerPath.toString());

        Path sourcePath = new Path(location + "\\src\\"+ classname + ".cpp");

 

        IWorkbench workbench = PlatformUI.getWorkbench();

        workbench.getDisplay().asyncExec(new Runnable() {

                public void run() {

            NewClassCodeGenerator generator = new NewClassCodeGenerator(headerPath

                                                                    , sourcePath

                                                                    , null

                                                                    , classname

                                                                    , null, null, null);

            JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

            try {                                                      

                generator.createClass(new NullProgressMonitor()); 

                JOptionPane.showMessageDialog( null, "createClass");

            } catch (CoreException e) {

                JOptionPane.showMessageDialog( null, "CoreException");

            } catch (Exception e) {

                JOptionPane.showMessageDialog( null, "Exception");

            }

        }

        });

    }

 

The program did not come to:

JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

 

If I removed workbench.getDisplay().asyncExec(new Runnable() and have the rest directly under creatClass(), the result is the same.

 

Desperately need all of yours guide. Actual working code better.

 

Thanks.

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, December 16, 2019 11:02 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

 

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

How to debug a loaded Eclipse plugin code (in Java) within Eclipse CDT version?

 

Eclipse IDE for C/C++ Developers

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Tuesday, December 17, 2019 10:33 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I am sorry I can't write any more code for you other than point you at the already written code available in CDT. As for mixing SWT/AWT I leave that up to you and the UMLet project - but you are correct, CDT does not use AWT. Have you tried stepping through the code that hangs, or pressing pause in the debugger to see what code it is stopped at? If you can provide either a stack trace of the hang, or if an exception is being thrown, then the stack trace of that would be helpful to diagnose the problem.

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Tue, 17 Dec 2019 at 04:10, Ming Cheng <[hidden email]> wrote:

Yes, I run my Eclipse plugin (modified UMLet plugin) inside

 

Eclipse IDE for C/C++ Developers

 

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

Honestly speaking I am not sure whether UMLet Eclipse eventually will mix SWT and AWT, but I just added extra CDT jars and some Eclipse platform jars to UMLet plugin.  However one possible good symptom is that umlet-gwt failed to compile in my environment  while I can still get umlet-eclipse-plugin jar file. If my assumption that Eclipse platform jars and CDT jars do not use AWT is valid, then I should not mix SWT and AWT together. Since original UMLet Eclipse plugin works well for Eclipse, I’d like to assume they should have solved SWT AWT harmony issue well (?).

 

The following code run well although nothing happen eventually:

 

private void generateAClass(String classname)

{

            IWorkbench workbench = PlatformUI.getWorkbench();

            workbench.getDisplay().asyncExec(new Runnable() {

            public void run() {

                NewClassCreationWizard wizard = new NewClassCreationWizard();

                wizard.setClassName(fileName);

                wizard.addPages();

                wizard.performFinish();

            }

            });

                                       

             JOptionPane.showMessageDialog( null, classname );

}

 

 

But this code hangs again:

 

public class EclipseOpenFile /*extends SectionPart */{

    private static final Logger log = LoggerFactory.getLogger(DiagramFileHandler.class);

    public static void createClass(String location, String classname) {

        Path headerPath = new Path(location + "\\include\\" + classname + ".h");

        JOptionPane.showMessageDialog( null, headerPath.toString());

        Path sourcePath = new Path(location + "\\src\\"+ classname + ".cpp");

 

        IWorkbench workbench = PlatformUI.getWorkbench();

        workbench.getDisplay().asyncExec(new Runnable() {

                public void run() {

            NewClassCodeGenerator generator = new NewClassCodeGenerator(headerPath

                                                                    , sourcePath

                                                                    , null

                                                                    , classname

                                                                    , null, null, null);

            JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

            try {                                                      

                generator.createClass(new NullProgressMonitor()); 

                JOptionPane.showMessageDialog( null, "createClass");

            } catch (CoreException e) {

                JOptionPane.showMessageDialog( null, "CoreException");

            } catch (Exception e) {

                JOptionPane.showMessageDialog( null, "Exception");

            }

        }

        });

    }

 

The program did not come to:

JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

 

If I removed workbench.getDisplay().asyncExec(new Runnable() and have the rest directly under creatClass(), the result is the same.

 

Desperately need all of yours guide. Actual working code better.

 

Thanks.

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, December 16, 2019 11:02 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

 

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

Since I don’t know how to dynamically debug Eclipse plugin code, especially CDT code part. I’d like to have my own CDT jars with tracing stmt.

 

I got CDT src from

 

[mcheng@pioneer org.eclipse.cdt]$ git remote show origin

* remote origin

  Fetch URL: git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

  Push  URL: git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

  HEAD branch: master

  Remote branches:

    cdt_8_0        tracked

    cdt_8_1        tracked

    cdt_8_2        tracked

    cdt_8_3        tracked

    cdt_8_4        tracked

    cdt_8_5        tracked

    cdt_8_6        tracked

    cdt_8_7        tracked

    cdt_8_8        tracked

    cdt_9_0        tracked

    cdt_9_1        tracked

    cdt_9_10       new (next fetch will store in remotes/origin)

    cdt_9_2        tracked

    cdt_9_3        tracked

    cdt_9_4        tracked

    cdt_9_5        tracked

    cdt_9_6        tracked

    cdt_9_7        tracked

    cdt_9_8        tracked

    cdt_9_9        tracked

    containerbuild tracked

    master         tracked

  Local branch configured for 'git pull':

    master merges with remote master

  Local ref configured for 'git push':

    master pushes to master (local out of date)

 

I tried to build with command:

 

mvn clean install

 

but with a lot of error (please refer to the attached file). Please kindly give some guide.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 10:49 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

How to debug a loaded Eclipse plugin code (in Java) within Eclipse CDT version?

 

Eclipse IDE for C/C++ Developers

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Tuesday, December 17, 2019 10:33 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I am sorry I can't write any more code for you other than point you at the already written code available in CDT. As for mixing SWT/AWT I leave that up to you and the UMLet project - but you are correct, CDT does not use AWT. Have you tried stepping through the code that hangs, or pressing pause in the debugger to see what code it is stopped at? If you can provide either a stack trace of the hang, or if an exception is being thrown, then the stack trace of that would be helpful to diagnose the problem.

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Tue, 17 Dec 2019 at 04:10, Ming Cheng <[hidden email]> wrote:

Yes, I run my Eclipse plugin (modified UMLet plugin) inside

 

Eclipse IDE for C/C++ Developers

 

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

Honestly speaking I am not sure whether UMLet Eclipse eventually will mix SWT and AWT, but I just added extra CDT jars and some Eclipse platform jars to UMLet plugin.  However one possible good symptom is that umlet-gwt failed to compile in my environment  while I can still get umlet-eclipse-plugin jar file. If my assumption that Eclipse platform jars and CDT jars do not use AWT is valid, then I should not mix SWT and AWT together. Since original UMLet Eclipse plugin works well for Eclipse, I’d like to assume they should have solved SWT AWT harmony issue well (?).

 

The following code run well although nothing happen eventually:

 

private void generateAClass(String classname)

{

            IWorkbench workbench = PlatformUI.getWorkbench();

            workbench.getDisplay().asyncExec(new Runnable() {

            public void run() {

                NewClassCreationWizard wizard = new NewClassCreationWizard();

                wizard.setClassName(fileName);

                wizard.addPages();

                wizard.performFinish();

            }

            });

                                       

             JOptionPane.showMessageDialog( null, classname );

}

 

 

But this code hangs again:

 

public class EclipseOpenFile /*extends SectionPart */{

    private static final Logger log = LoggerFactory.getLogger(DiagramFileHandler.class);

    public static void createClass(String location, String classname) {

        Path headerPath = new Path(location + "\\include\\" + classname + ".h");

        JOptionPane.showMessageDialog( null, headerPath.toString());

        Path sourcePath = new Path(location + "\\src\\"+ classname + ".cpp");

 

        IWorkbench workbench = PlatformUI.getWorkbench();

        workbench.getDisplay().asyncExec(new Runnable() {

                public void run() {

            NewClassCodeGenerator generator = new NewClassCodeGenerator(headerPath

                                                                    , sourcePath

                                                                    , null

                                                                    , classname

                                                                    , null, null, null);

            JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

            try {                                                      

                generator.createClass(new NullProgressMonitor()); 

                JOptionPane.showMessageDialog( null, "createClass");

            } catch (CoreException e) {

                JOptionPane.showMessageDialog( null, "CoreException");

            } catch (Exception e) {

                JOptionPane.showMessageDialog( null, "Exception");

            }

        }

        });

    }

 

The program did not come to:

JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

 

If I removed workbench.getDisplay().asyncExec(new Runnable() and have the rest directly under creatClass(), the result is the same.

 

Desperately need all of yours guide. Actual working code better.

 

Thanks.

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, December 16, 2019 11:02 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

 

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

result.txt (111K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Alexander Fedorov
Dear Ming Cheng,

You have a lot of questions and the good part of them are about generic topics like Eclipse Platform development, Eclipse Workbench usage and so on.
Please have a look at the documentation first - it covers the topics you are interested in: https://help.eclipse.org/2019-09/index.jsp

This mailing list is to discuss CDT-specific topics.

Thanks,
AF

18.12.2019 7:30, Ming Cheng пишет:

Since I don’t know how to dynamically debug Eclipse plugin code, especially CDT code part. I’d like to have my own CDT jars with tracing stmt.

 

I got CDT src from

 

[mcheng@pioneer org.eclipse.cdt]$ git remote show origin

* remote origin

  Fetch URL: git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

  Push  URL: git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

  HEAD branch: master

  Remote branches:

    cdt_8_0        tracked

    cdt_8_1        tracked

    cdt_8_2        tracked

    cdt_8_3        tracked

    cdt_8_4        tracked

    cdt_8_5        tracked

    cdt_8_6        tracked

    cdt_8_7        tracked

    cdt_8_8        tracked

    cdt_9_0        tracked

    cdt_9_1        tracked

    cdt_9_10       new (next fetch will store in remotes/origin)

    cdt_9_2        tracked

    cdt_9_3        tracked

    cdt_9_4        tracked

    cdt_9_5        tracked

    cdt_9_6        tracked

    cdt_9_7        tracked

    cdt_9_8        tracked

    cdt_9_9        tracked

    containerbuild tracked

    master         tracked

  Local branch configured for 'git pull':

    master merges with remote master

  Local ref configured for 'git push':

    master pushes to master (local out of date)

 

I tried to build with command:

 

mvn clean install

 

but with a lot of error (please refer to the attached file). Please kindly give some guide.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 10:49 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

How to debug a loaded Eclipse plugin code (in Java) within Eclipse CDT version?

 

Eclipse IDE for C/C++ Developers

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Tuesday, December 17, 2019 10:33 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I am sorry I can't write any more code for you other than point you at the already written code available in CDT. As for mixing SWT/AWT I leave that up to you and the UMLet project - but you are correct, CDT does not use AWT. Have you tried stepping through the code that hangs, or pressing pause in the debugger to see what code it is stopped at? If you can provide either a stack trace of the hang, or if an exception is being thrown, then the stack trace of that would be helpful to diagnose the problem.

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Tue, 17 Dec 2019 at 04:10, Ming Cheng <[hidden email]> wrote:

Yes, I run my Eclipse plugin (modified UMLet plugin) inside

 

Eclipse IDE for C/C++ Developers

 

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

 

Honestly speaking I am not sure whether UMLet Eclipse eventually will mix SWT and AWT, but I just added extra CDT jars and some Eclipse platform jars to UMLet plugin.  However one possible good symptom is that umlet-gwt failed to compile in my environment  while I can still get umlet-eclipse-plugin jar file. If my assumption that Eclipse platform jars and CDT jars do not use AWT is valid, then I should not mix SWT and AWT together. Since original UMLet Eclipse plugin works well for Eclipse, I’d like to assume they should have solved SWT AWT harmony issue well (?).

 

The following code run well although nothing happen eventually:

 

private void generateAClass(String classname)

{

            IWorkbench workbench = PlatformUI.getWorkbench();

            workbench.getDisplay().asyncExec(new Runnable() {

            public void run() {

                NewClassCreationWizard wizard = new NewClassCreationWizard();

                wizard.setClassName(fileName);

                wizard.addPages();

                wizard.performFinish();

            }

            });

                                       

             JOptionPane.showMessageDialog( null, classname );

}

 

 

But this code hangs again:

 

public class EclipseOpenFile /*extends SectionPart */{

    private static final Logger log = LoggerFactory.getLogger(DiagramFileHandler.class);

    public static void createClass(String location, String classname) {

        Path headerPath = new Path(location + "\\include\\" + classname + ".h");

        JOptionPane.showMessageDialog( null, headerPath.toString());

        Path sourcePath = new Path(location + "\\src\\"+ classname + ".cpp");

 

        IWorkbench workbench = PlatformUI.getWorkbench();

        workbench.getDisplay().asyncExec(new Runnable() {

                public void run() {

            NewClassCodeGenerator generator = new NewClassCodeGenerator(headerPath

                                                                    , sourcePath

                                                                    , null

                                                                    , classname

                                                                    , null, null, null);

            JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

            try {                                                      

                generator.createClass(new NullProgressMonitor()); 

                JOptionPane.showMessageDialog( null, "createClass");

            } catch (CoreException e) {

                JOptionPane.showMessageDialog( null, "CoreException");

            } catch (Exception e) {

                JOptionPane.showMessageDialog( null, "Exception");

            }

        }

        });

    }

 

The program did not come to:

JOptionPane.showMessageDialog( null, "NewClassCodeGenerator");

 

If I removed workbench.getDisplay().asyncExec(new Runnable() and have the rest directly under creatClass(), the result is the same.

 

Desperately need all of yours guide. Actual working code better.

 

Thanks.

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Monday, December 16, 2019 11:02 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I think mixing SWT and AWT is going to give you no end of issues, it is possible, but I would try to stick to one or the other. If you need to use both, read up about the SWT AWT bridges. 

 

The code snippet sounds like it is throwing an exception or is hanging. That line (indirectly) does this CUIPlugin.getDefault().getDialogSettings() which needs an Eclipse workspace. Do you have an Eclipse workspace?

 

However you said you didn't want an SWT wizard anyway so read the source of the wizard and you can reuse the source too (as long as you license your code with the EPL), for example, look at NewClassCodeGenerator, it is instantiated by NewClassCreationWizardPage.createClass().

 

Jonah


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Mon, 16 Dec 2019 at 00:16, Ming Cheng <[hidden email]> wrote:

Hi Alexander and All,

 

I changed code to:

 

JOptionPane.showMessageDialog( null, "generateAClass" );

NewClassCreationWizard page = new NewClassCreationWizard();

JOptionPane.showMessageDialog( null, classname );

 

But the same result (only see first showMessageDialog).

 

In fact I don't need Wizard popup window. I just need to have a simple way to create .h and .cpp files. If possible, please give me a almost there snipet.

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Friday, December 13, 2019 6:27 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi Ming Cheng,

You need to read a bit about how Eclipse JFace and Eclipse Workbench is working. I added the answer below to your GitHub issue as well.

> NewClassCreationWizardPage page = new NewClassCreationWizardPage();

the WizardPage is designed to live inside the Wizard. Please have a closer look to the surrounding code, where should be a Wizard that instantiates this page. What you need to "emulate" the result of wizard work is the content of its "performFinish()" method.

Regards,
AF

13.12.2019 12:59, Ming Cheng пишет:

Hi Jonah,

 

I am following your suggestion about new C++ class but can’t move. I logged an issue to “my” tool

 

https://github.com/umlet/umlet/issues/562

 

Thanks.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 5, 2019 10:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Hi,

 

I had a quick look at all these questions - I am not surprised that no one has answered on the forums, the forums are really meant for Users of the Eclipse CDT IDE - i.e. people writing C/C++ code.

 

I don't have answers to most of your questions, but I can try an answer on some of them:

 

> How to stop inserting same include stmt more than once

 

Try looking at how organize imports in CDT is implemented, it manipulates includes so may give you a good idea.

 

>  How to load a file content into a new editor tab

 

Look up the IDE class in Eclipse platform (such as openEditor method)

 

> How to use CDT to create a .h with a class decl?

 

Look how the new C++ class wizard is implemented for some clues.

 


I don't t


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Christian Walther-2
In reply to this post by Ming Cheng
Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code
>  
> ...
>  
> I tried to build with command:
>  
> mvn clean install
>  
> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 


From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum
 
Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

771357590953412FB05A74CE4F94946C.png (196 bytes) Download Attachment
771357590953412FB05A74CE4F94946C.png (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

·         In the editor that just opened, click Set as Target Platform on the top right.

Eclipse will now download the required dependencies, which may take some time the first time. Once this is done, it should trigger a full build of your workspace and a lot of errors should go away.

Issue 1

I couldn’t Set as Target Platform on the top right.

However I can see a lot of .class files being generated.

 

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open the PDE (Plug-in Development Environment) perspective:  Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

 

Issue 2

I couldn’t follow the above steps bcos I can’t find a project with the name org.eclipse.cdt.ui.

 

 

Issue 3.

 

How to generate jar files like these:

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 10:07 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

 

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

 

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng

My Eclipse env: (I couldn’t Set as Target Platform on the top right.)

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 11:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

·         In the editor that just opened, click Set as Target Platform on the top right.

Eclipse will now download the required dependencies, which may take some time the first time. Once this is done, it should trigger a full build of your workspace and a lot of errors should go away.

Issue 1

I couldn’t Set as Target Platform on the top right.

However I can see a lot of .class files being generated.

 

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open the PDE (Plug-in Development Environment) perspective:  Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

 

Issue 2

I couldn’t follow the above steps bcos I can’t find a project with the name org.eclipse.cdt.ui.

 

 

Issue 3.

 

How to generate jar files like these:

 

cid:image003.png@01D5B65B.A1951980

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 10:07 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

 

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

 

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
In reply to this post by Ming Cheng
Have a look at this great tutorial on how to write eclipse plugins. Some of it goes into issues that you don't need to know about yet, so focus on chapters 1 to 5 to start, and have a look at 17 to 22 for more topics. As you become more experienced you can revisit the other chapters. 

https://www.vogella.com/tutorials/EclipsePlugin/article.html

BTW, it sounds like your goal is to extend umlet? Have you engaged anyone from that project yet? As they already have eclipse plugins, they may have better advice on how to edit their own code. I/we can try to point you in the right direction of how to use CDT code, but as you seem to be going off the beaten path you are probably going to have to figure your own way through on most of this. 

PS what is the context of your work. For example is this for a commercial product, open source project or academic work? 

Thanks, 
Jonah 


On Wed., Dec. 18, 2019, 22:01 Ming Cheng, <[hidden email]> wrote:

·         In the editor that just opened, click Set as Target Platform on the top right.

Eclipse will now download the required dependencies, which may take some time the first time. Once this is done, it should trigger a full build of your workspace and a lot of errors should go away.

Issue 1

I couldn’t Set as Target Platform on the top right.

However I can see a lot of .class files being generated.

 

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open the PDE (Plug-in Development Environment) perspective:  Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

 

Issue 2

I couldn’t follow the above steps bcos I can’t find a project with the name org.eclipse.cdt.ui.

 

 

Issue 3.

 

How to generate jar files like these:

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 10:07 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

 

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

 

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

cid:image001.png@01D5B653.67EEED30

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

312B41FF16264029838A744CA19AECB9.png (487K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Jonah Graham
In reply to this post by Ming Cheng
PS try changing which perspective you are in, and you can't set target platform because you already did it once so it has changed text to reload target platform. 

On Wed., Dec. 18, 2019, 22:11 Ming Cheng, <[hidden email]> wrote:

My Eclipse env: (I couldn’t Set as Target Platform on the top right.)

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 11:01 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

·         In the editor that just opened, click Set as Target Platform on the top right.

Eclipse will now download the required dependencies, which may take some time the first time. Once this is done, it should trigger a full build of your workspace and a lot of errors should go away.

Issue 1

I couldn’t Set as Target Platform on the top right.

However I can see a lot of .class files being generated.

 

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open the PDE (Plug-in Development Environment) perspective:  Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

 

Issue 2

I couldn’t follow the above steps bcos I can’t find a project with the name org.eclipse.cdt.ui.

 

 

Issue 3.

 

How to generate jar files like these:

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 10:07 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

 

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

 

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

A90FD678F2EE406AB92CC56BDB022312.png (487K) Download Attachment
E4C8008A144A481DA05F45643A96CAF0.png (482K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any comment is welcome to my topics in Eclipse Forum

Ming Cheng
In reply to this post by Jonah Graham

I’ll go through the tutorial.

 

Now it’s an experimental try. If it’s successful, it may become a internal tool (kind of commercial) .

 

I asked UMLet, they did not bother.

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 11:40 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Have a look at this great tutorial on how to write eclipse plugins. Some of it goes into issues that you don't need to know about yet, so focus on chapters 1 to 5 to start, and have a look at 17 to 22 for more topics. As you become more experienced you can revisit the other chapters. 

 

https://www.vogella.com/tutorials/EclipsePlugin/article.html

 

BTW, it sounds like your goal is to extend umlet? Have you engaged anyone from that project yet? As they already have eclipse plugins, they may have better advice on how to edit their own code. I/we can try to point you in the right direction of how to use CDT code, but as you seem to be going off the beaten path you are probably going to have to figure your own way through on most of this. 

 

PS what is the context of your work. For example is this for a commercial product, open source project or academic work? 

 

Thanks, 

Jonah 

 

On Wed., Dec. 18, 2019, 22:01 Ming Cheng, <[hidden email]> wrote:

·         In the editor that just opened, click Set as Target Platform on the top right.

Eclipse will now download the required dependencies, which may take some time the first time. Once this is done, it should trigger a full build of your workspace and a lot of errors should go away.

Issue 1

I couldn’t Set as Target Platform on the top right.

However I can see a lot of .class files being generated.

 

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open the PDE (Plug-in Development Environment) perspective:  Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

 

Issue 2

I couldn’t follow the above steps bcos I can’t find a project with the name org.eclipse.cdt.ui.

 

 

Issue 3.

 

How to generate jar files like these:

 

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Thursday, December 19, 2019 10:07 AM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

It's in releng/org.eclipse.cdt.target, try importing it directly. Here is the link to it in the git browser:

 

https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/releng/org.eclipse.cdt.target

 

On Wed., Dec. 18, 2019, 21:02 Ming Cheng, <[hidden email]> wrote:

o set the target platform:

·         Expand the "org.eclipse.cdt.target" project.

·         Double-click on cdt.target.

·         In the editor that just opened, click Set as Target Platform on the top right.

 

When clone and import, I selected all, but still can’t see “org.eclipse.cdt.target" project.

Now I am using 9.10.0

 

Sent from Mail for Windows 10

 

From: [hidden email]
Sent: Wednesday, December 18, 2019 3:15 PM
To: [hidden email]
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Got it and thanks Christian.

 

Sent from Mail for Windows 10

 

From: [hidden email] <[hidden email]> on behalf of Christian Walther <[hidden email]>
Sent: Wednesday, December 18, 2019 3:05:20 PM
To: CDT General developers list. <[hidden email]>
Subject: Re: [cdt-dev] Any comment is welcome to my topics in Eclipse Forum

 

Ming Cheng wrote:
> I don’t know how to dynamically debug Eclipse plugin code

> ...

> I tried to build with command:

> mvn clean install

> but with a lot of error (please refer to the attached file).

I'm not sure, but at a glance it could be that your Maven and/or Tycho are too old for pom-less building. Look inside the top-level pom.xml, it mentions some versions.

However, for debugging it is more convenient to build in Eclipse (PDE) than with Maven. It is described very well in https://wiki.eclipse.org/Getting_started_with_CDT_development .

 -Christian
_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 

_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/cdt-dev
12