From: <sh...@us...> - 2010-05-30 10:24:58
|
Revision: 17928 http://jedit.svn.sourceforge.net/jedit/?rev=17928&view=rev Author: shlomy Date: 2010-05-30 10:24:52 +0000 (Sun, 30 May 2010) Log Message: ----------- Put the tag description of the selected tag from the completion popup below the list, and enable enough space to see all the information there. Modified Paths: -------------- plugins/CtagsInterface/trunk/src/ctagsinterface/jedit/TagCompletionPopup.java Modified: plugins/CtagsInterface/trunk/src/ctagsinterface/jedit/TagCompletionPopup.java =================================================================== --- plugins/CtagsInterface/trunk/src/ctagsinterface/jedit/TagCompletionPopup.java 2010-05-30 09:27:10 UTC (rev 17927) +++ plugins/CtagsInterface/trunk/src/ctagsinterface/jedit/TagCompletionPopup.java 2010-05-30 10:24:52 UTC (rev 17928) @@ -1,5 +1,6 @@ package ctagsinterface.jedit; +import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.Point; @@ -30,23 +31,28 @@ desc = new JTextArea(); desc.append("The description\nof this item"); desc.setBorder(BorderFactory.createEtchedBorder()); + desc.setRows(8); Container c = getContentPane(); - JPanel p = new JPanel(new GridLayout(1, 0)); - p.add(c); - p.add(new JScrollPane(desc)); + JPanel p = new JPanel(new BorderLayout()); + p.add(c, BorderLayout.CENTER); + p.add(new JScrollPane(desc), BorderLayout.SOUTH); setContentPane(p); } - - + public void setSelectedTag(Tag tag) { if (! GeneralOptionPane.getCompleteDesc()) return; + desc.setText(getDescription(tag)); + } + + private String getDescription(Tag tag) + { StringBuffer sb = new StringBuffer(); sb.append(tag.getFile() + ":" + tag.getLine() + "\n"); for (String ext: tag.getExtensions()) sb.append(ext + ": " + tag.getExtension(ext) + "\n"); - desc.setText(sb.toString()); + return sb.toString(); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |