mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Making bean of LinkLabel so it can be used in UIDesigner.
This commit is contained in:
@@ -8,6 +8,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.ui.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -43,6 +44,10 @@ public class LinkLabel extends JLabel {
|
||||
protected final int DEFAULT_ICON_GAP = 2;
|
||||
private static final Icon LINK = IconLoader.getIcon("/ide/link.png");
|
||||
|
||||
public LinkLabel() {
|
||||
this("", LINK);
|
||||
}
|
||||
|
||||
public LinkLabel(String text, Icon icon) {
|
||||
this(text, icon, null, null, null);
|
||||
}
|
||||
@@ -208,6 +213,7 @@ public class LinkLabel extends JLabel {
|
||||
}
|
||||
|
||||
private void setStatusBarText(String statusBarText) {
|
||||
if (ApplicationManager.getApplication() == null) return; // makes this component work in UIDesigner preview.
|
||||
final Project[] projects = ProjectManager.getInstance().getOpenProjects();
|
||||
for (int i = 0; i < projects.length; i++) {
|
||||
WindowManager.getInstance().getStatusBar(projects[i]).setInfo(statusBarText);
|
||||
|
||||
Reference in New Issue
Block a user