I would like to write a plugin that displays hyperlinks to content on the web. How do I include these?
Maybe you could elaborate a bit more on how your plugin is going to work. Displaying a hyperlink is probably doable but how to do it depends heavily on where you want them to show up (in the editor?, in some settings page? in some flyout?)..
I would like to write a plugin which sits in the area above the status bar (along with TODO etc), or perhaps in the right-most groups. This plugin should be able to display a set of help links, and clicking on one of these should open a browser and load the URL specified.
I would like to write a plugin which sits in the area above the status bar (along with TODO etc), or perhaps in the right-most groups. This plugin should be able to display a set of help links, and clicking on one of these should open a browser and load the URL specified.
>
This is relatively easy. You need to create a project component and register it to your plugin.xml. Then inside the project component you can register a tool window like this:
Then you'd just have to implement the YourLinkPanel class, which contains the links you want to display, but this is simple Swing Code then.
On 29.04.10 08:05, Luanne Misquitta wrote: > I would like to write a plugin which sits in the area above the status bar (along with TODO etc), or perhaps in the right-most groups. This plugin should be able to display a set of help links, and clicking on one of these should open a browser and load the URL specified. >
This is relatively easy. You need to create a project component and register it to your plugin.xml. Then inside the project component you can register a tool window like this:
public class YourProjectComponent extends AbstractProjectComponent { public static final String TOOL_WINDOW_ID = "Help Links";
On 28.04.10 11:03, Luanne Misquitta wrote:
Maybe you could elaborate a bit more on how your plugin is going to
work. Displaying a hyperlink is probably doable but how to do it depends
heavily on where you want them to show up (in the editor?, in some
settings page? in some flyout?)..
I would like to write a plugin which sits in the area above the status bar (along with TODO etc), or perhaps in the right-most groups. This plugin should be able to display a set of help links, and clicking on one of these should open a browser and load the URL specified.
Thanks
Luanne
On 29.04.10 08:05, Luanne Misquitta wrote:
>
This is relatively easy. You need to create a project component and
register it to your plugin.xml. Then inside the project component you
can register a tool window like this:
Then you'd just have to implement the YourLinkPanel class, which
contains the links you want to display, but this is simple Swing Code then.
Hope this helps.
Kind regards,
Jan
Hi Jan,
Some of your post is missing...could you re-post please?
Thanks
Luanne
Dum di dum... Lets see if this one works...
On 29.04.10 08:05, Luanne Misquitta wrote:
> I would like to write a plugin which sits in the area above the
status bar (along with TODO etc), or perhaps in the right-most groups.
This plugin should be able to display a set of help links, and clicking
on one of these should open a browser and load the URL specified.
>
This is relatively easy. You need to create a project component and
register it to your plugin.xml. Then inside the project component you
can register a tool window like this:
public class YourProjectComponent extends AbstractProjectComponent {
public static final String TOOL_WINDOW_ID = "Help Links";
protected YourProjectComponent(Project project) {
super(project);
}
@Override
public void initComponent() {
super.initComponent();
final YourLinkPanel panel = new YourLinkPanel();
final ToolWindowManagerEx manager =
ToolWindowManagerEx.getInstanceEx(myProject);
runWhenInitialized(myProject, new Runnable() {
public void run() {
final ToolWindow window =
manager.registerToolWindow(TOOL_WINDOW_ID, panel,
ToolWindowAnchor.RIGHT, myProject, true);
}
});
}
}
Then you'd just have to implement the YourLinkPanel class, which
contains the links you want to display, but this is simple Swing Code then.
Hope this helps.
Kind regards,
Jan
Thank you so much for the help!
Hi @..., Hi Jan Thomä
Could you please advise how to make a text work like a hyperlink (click it, then open a browser to browser the url)? Thanks.
I tried to Desktop.getDesktop.browser(URL), but the plugin will collapse (never able to be opened) with the following error:
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'rootPane' of com/intellij/util/ui/UIUtil.setCustomTitleBar must not be null
Thanks