Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Adding menu for perspective Plugin development(Creating and customizing perspective)
Adding menu for perspective Plugin development [message #1833642] Tue, 20 October 2020 09:40 Go to next message
Duy Tran is currently offline Duy TranFriend
Messages: 8
Registered: October 2020
Junior Member
Hello team,

I am creating a customized Perspective in Eclipse E4 plugin development. I created a Perspective and added Part Stack > Part > Menu > Handled Menu Item but when I changed to the new Perspective the Menu did not appear. In the Part Class URI I linked with the follow Java Class:

public class PerspectivePart
{
private Label myLabelInView;

@PostConstruct
public void postConstruct(Composite parent)
{
myLabelInView = new Label(parent, SWT.BORDER);
myLabelInView.setText("This is a sample E4 view");

// MessageDialog.openInformation(null, "E4 Information Dialog", "Goodbye cruel world from a pure Eclipse 4 plug-in");

System.out.println("Perspective opened");
}
}

There was nothing except the string "Perspective opened" printed on the console. Can you show me how to make the menu or a window appear when I open my Perspective?

Thanks and best regards,
Duy Tran

[Updated on: Tue, 20 October 2020 15:50]

Report message to a moderator

Re: Adding menu for perspective Plugin development [message #1833731 is a reply to message #1833642] Thu, 22 October 2020 18:44 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

You are not setting a layout on the composite. Try parent.setLayout(new FillLayout());
Re: Adding menu for perspective Plugin development [message #1833769 is a reply to message #1833731] Fri, 23 October 2020 15:15 Go to previous messageGo to next message
Duy Tran is currently offline Duy TranFriend
Messages: 8
Registered: October 2020
Junior Member
Hi Wim,

It works!! Thanks. I have another question, do you know how to add the Menu Contribution to the Perspective. It it like whenever I open my Perspective, a Menu Contribution will appear and when I close it, the menu will disappear. I tried to find on google but it seems I don't know the correct key word.

Duy
  • Attachment: project.png
    (Size: 6.84KB, Downloaded 60 times)
Re: Adding menu for perspective Plugin development [message #1833808 is a reply to message #1833769] Sat, 24 October 2020 11:16 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Please file a new question.
Previous Topic:Contribute a binding context with a fragment
Next Topic:Unable to resolve plug-in "org.eclipse.egit.ui"
Goto Forum:
  


Current Time: Thu Apr 25 10:14:45 GMT 2024

Powered by FUDForum. Page generated in 0.02858 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top