From eb86aeafa34d8da30788b612cf74722006b0ce47 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 4 Feb 2010 12:29:44 +0300 Subject: [PATCH] artifact editor ui fixes --- .../artifacts/ArtifactEditorImpl.java | 28 ++++++++++++++---- platform/icons/src/general/help.png | Bin 0 -> 264 bytes .../src/messages/ProjectBundle.properties | 3 ++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 platform/icons/src/general/help.png diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java index 6da7af64f4e7..058e1c427034 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java @@ -15,6 +15,8 @@ */ package com.intellij.openapi.roots.ui.configuration.artifacts; +import com.intellij.codeInsight.hint.HintManager; +import com.intellij.codeInsight.hint.HintUtil; import com.intellij.ide.CommonActionsManager; import com.intellij.ide.DataManager; import com.intellij.ide.DefaultTreeExpander; @@ -49,10 +51,8 @@ import com.intellij.packaging.impl.artifacts.ArtifactUtil; import com.intellij.packaging.impl.elements.ArchivePackagingElement; import com.intellij.packaging.impl.elements.ManifestFileUtil; import com.intellij.packaging.ui.ManifestFileConfiguration; -import com.intellij.ui.PopupHandler; -import com.intellij.ui.ScrollPaneFactory; -import com.intellij.ui.TabbedPaneWrapper; -import com.intellij.ui.TreeToolTipHandler; +import com.intellij.ui.*; +import com.intellij.ui.awt.RelativePoint; import com.intellij.util.EventDispatcher; import com.intellij.util.Icons; import com.intellij.util.ui.ThreeStateCheckBox; @@ -61,6 +61,8 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.border.Border; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -201,7 +203,23 @@ public class ArtifactEditorImpl implements ArtifactEditorEx { final JPanel rightPanel = new JPanel(new BorderLayout()); final JPanel rightTopPanel = new JPanel(new BorderLayout()); - rightTopPanel.add(new JLabel("Available Elements (drag'n'drop to layout tree)"), BorderLayout.SOUTH); + final JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + labelPanel.add(new JLabel("Available Elements")); + final HyperlinkLabel link = new HyperlinkLabel(""); + link.setIcon(IconLoader.getIcon("/general/help.png")); + link.addHyperlinkListener(new HyperlinkListener() { + public void hyperlinkUpdate(HyperlinkEvent e) { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + final JLabel label = new JLabel(ProjectBundle.message("artifact.source.items.tree.tooltip")); + label.setBorder(HintUtil.createHintBorder()); + label.setBackground(HintUtil.INFORMATION_COLOR); + label.setOpaque(true); + HintManager.getInstance().showHint(label, RelativePoint.getSouthEastOf(link), HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE, -1); + } + } + }); + labelPanel.add(link); + rightTopPanel.add(labelPanel, BorderLayout.SOUTH); rightPanel.add(rightTopPanel, BorderLayout.NORTH); rightPanel.add(ScrollPaneFactory.createScrollPane(mySourceItemsTree), BorderLayout.CENTER); rightPanel.setBorder(border); diff --git a/platform/icons/src/general/help.png b/platform/icons/src/general/help.png new file mode 100644 index 0000000000000000000000000000000000000000..dd245b7cee5b71632d249b6d52b2ed35272c0412 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2VGmzZ%#=aj&F%}28J29*~C-V}>F$?esaRt&z zNlE?v{Us$Oetv$LnVD^EZ5|#TwY9aev9VE6QK_k^U0q#?iHVJkjsO4ukD2uN@4x>O zV=@vz#+3y51v5B2yO9RsBze2LFm$lWdH^|`1s;*b3=G`DAk4@xYmNj^kiEpy*OmPi z6AQbAOb^rY_dp>#PZ!4!j_BkBfd(cvHbzGc0S3dFH!Nl-`pDVU)rG}%XxQ7EtJ~Yp v&^&SC=y`rY)=uZGoSQZr_G#!;TEoC#%*DFI!NUC$&?E*=S3j3^P68-! literal 0 HcmV?d00001 diff --git a/platform/platform-resources-en/src/messages/ProjectBundle.properties b/platform/platform-resources-en/src/messages/ProjectBundle.properties index 374e51fe6e79..7fbfa4dcef38 100644 --- a/platform/platform-resources-en/src/messages/ProjectBundle.properties +++ b/platform/platform-resources-en/src/messages/ProjectBundle.properties @@ -435,6 +435,9 @@ dialog.title.extract.artifact=Extract Artifact action.name.inline.artifact=Inline Artifact action.name.rename.packaging.element=Rename drag.n.drop.text.0.packaging.elements={0} elements +artifact.source.items.tree.tooltip=Double-click on element to put into default location
\ + Drag-and-drop element to add into the desired location
\ + More actions are available in the popup menu #new project wizard module.type.empty.name=Empty Project