Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Directory Dialog in a E4 Part(Popup dialog is not triggered in a postconstruct method)
Directory Dialog in a E4 Part [message #1733287] Thu, 26 May 2016 01:18 Go to next message
Claudiu Iordache is currently offline Claudiu IordacheFriend
Messages: 2
Registered: May 2016
Junior Member
Hello,

Can anyone help me please with the following issue..I have a Part in which I have a label with an image and with a mouse listener. When a user clicks on it, a Directory Dialog should be triggered...but I cannot get correctly the Shell as parameter for Directory Dialog. The code is:

public class ReportExporerPart {


@Inject
public ReportExporerPart() {

}

@PostConstruct
public void postConstruct(Composite parent) {
FillLayout fl_parent = new FillLayout(SWT.HORIZONTAL);
parent.setLayout(fl_parent);

Label lblNewLabel = new Label(parent, SWT.CENTER);
lblNewLabel.setImage(SWTResourceManager.getImage(ReportExporerPart.class, "/javax/swing/plaf/metal/icons/ocean/directory.gif"));
lblNewLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
DirectoryDialog dlg = new DirectoryDialog(parent.getShell());
dlg.setText("Report Chooser");
dlg.setMessage("Select a directory");
}
});
}


@PreDestroy
public void preDestroy() {

}


@Focus
public void onFocus() {

}
}

Nothing happens if i use "parent.getShell()" and I do not understand why..Any clue?
Re: Directory Dialog in a E4 Part [message #1733360 is a reply to message #1733287] Thu, 26 May 2016 20:41 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Don't you need to call open() on the dialog to show it?
Re: Directory Dialog in a E4 Part [message #1733428 is a reply to message #1733360] Fri, 27 May 2016 11:45 Go to previous message
Claudiu Iordache is currently offline Claudiu IordacheFriend
Messages: 2
Registered: May 2016
Junior Member
Ohh...damn,yes...i was so blind with troubles like dependency injection that i forgat that..thanks for the hint! actually was a stupid issue
Previous Topic:e4 perspective with e3 editor area (org.eclipse.ui.editorss)
Next Topic:Splash Screen with Progress Bar and Messages
Goto Forum:
  


Current Time: Thu Apr 25 21:07:18 GMT 2024

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

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

Back to the top