Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Open file or project from content assist(CTRL+Space) proposals(want to open a file from proposals)
Open file or project from content assist(CTRL+Space) proposals [message #1763413] Mon, 15 May 2017 13:59 Go to next message
saravanakumar Mohanasundaram is currently offline saravanakumar MohanasundaramFriend
Messages: 19
Registered: February 2017
Junior Member
Hi All,
In xml editor, i have implemented my own content assist in which i am showing list of file as proposals.

1. I want to open a file if i click a proposal. is it possible?
2. is it possible to open a file from additional info dialog?
3. If any one is possible then please guide me to do the same.

index.php/fa/29349/0/

index.php/fa/29392/0/




Thanks in advance.
Regards,
saravanakumar M
  • Attachment: sample.png
    (Size: 23.10KB, Downloaded 404 times)
  • Attachment: link.png
    (Size: 35.55KB, Downloaded 383 times)

[Updated on: Thu, 18 May 2017 07:33]

Report message to a moderator

Re: Open file or project from content assist(CTRL+Space) proposals [message #1764030 is a reply to message #1763413] Wed, 24 May 2017 08:25 Go to previous messageGo to next message
saravanakumar Mohanasundaram is currently offline saravanakumar MohanasundaramFriend
Messages: 19
Registered: February 2017
Junior Member
Hello all,

This can be done by creating your own informationcontrol class which extends extends AbstractInformationControl

@Override
public IInformationControlCreator getInformationControlCreator(
final ISourceViewer sourceViewer) {
// TODO Auto-generated method stub
return new IInformationControlCreator() {

@Override
public IInformationControl createInformationControl(Shell parent) {

MyInformationControl iControl = new MyInformationControl(
parent);
return iControl;
}
};

}
Re: Open file or project from content assist(CTRL+Space) proposals [message #1764033 is a reply to message #1763413] Wed, 24 May 2017 08:28 Go to previous message
saravanakumar Mohanasundaram is currently offline saravanakumar MohanasundaramFriend
Messages: 19
Registered: February 2017
Junior Member
Hello all,

This can be done by creating your own informationcontrol class which extends AbstractInformationControl

1. Override the below method in sourceviewerconfiguration
@Override
	public IInformationControlCreator getInformationControlCreator(
			final ISourceViewer sourceViewer) {
		// TODO Auto-generated method stub
		return new IInformationControlCreator() {

			@Override
			public IInformationControl createInformationControl(Shell parent) {

				MyInformationControl iControl = new MyInformationControl(
						parent);
				return iControl;
			}
		};

	}


2. Create informationcontrol class:
public class MyInformationControl extends AbstractInformationControl {

	public MyInformationControl (Shell parentShell) {
		super(parentShell);
		create();
	}

	@Override
	public boolean hasContents() {
		// TODO Auto-generated method stub
		return true;
	}
	private Link link;

	@Override
	protected void createContent(Composite parent) {

		link = new Link(parent, SWT.BORDER);

		link.addSelectionListener(new SelectionAdapter()  {
			 
		    @Override
		    public void widgetSelected(SelectionEvent event) {
// your code
			}
		});
	}
	@Override
	public void setInformation(String content) {
		link.setText("<a>" + content + "</a>");
	}
}


Regards,
saravanakumar

[Updated on: Wed, 24 May 2017 08:33]

Report message to a moderator

Previous Topic:Getting Eclipse Preference Page values Programmatically
Next Topic:how do i hook XML editor to the back and forward buttons
Goto Forum:
  


Current Time: Thu Apr 18 21:14:29 GMT 2024

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

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

Back to the top