1.1 --- a/bpel.editors.api/src/org/netbeans/modules/bpel/editors/api/utils/RefactorUtil.java Fri Oct 05 13:50:51 2007 +0000
1.2 +++ b/bpel.editors.api/src/org/netbeans/modules/bpel/editors/api/utils/RefactorUtil.java Fri Oct 05 13:55:31 2007 +0000
1.3 @@ -149,7 +149,7 @@
1.4 String type = getType(component);
1.5
1.6 if (type != null) {
1.7 - return type + " '" + getName(component) + "'";
1.8 + return "<html>" + type + " <b>" + getName(component) + "</b></html>";
1.9 }
1.10 return getName(component);
1.11 }
2.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/action/Bundle.properties Fri Oct 05 13:50:51 2007 +0000
2.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/action/Bundle.properties Fri Oct 05 13:55:31 2007 +0000
2.3 @@ -42,7 +42,7 @@
2.4 CTL_Search_Action=Advanced Search ...
2.5
2.6 # ManagerAction
2.7 -TLT_Search_Action=Advanced Search ... (Ctrl+Alt+Shift+F)
2.8 +TLT_Search_Action=Advanced Search - Ctrl+Alt+Shift+F
2.9
2.10 # Target
2.11 Component=Any Component
3.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Bundle.properties Fri Oct 05 13:50:51 2007 +0000
3.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Bundle.properties Fri Oct 05 13:55:31 2007 +0000
3.3 @@ -57,13 +57,14 @@
3.4 # Tree
3.5 # {0} - text to be found
3.6 # {1} - count of occurrences
3.7 -LBL_Found_Occurrences=Found ''{0}'' {1} occurrences
3.8 +LBL_Found_Occurrences=Found <b>{0}</b> - {1} occurrences
3.9 # {0} - search result
3.10 LBL_Tree_Name=Search Results - {0}
3.11 LBL_Go_to_Source=Go to Source
3.12 LBL_Select=Go to Design
3.13 LBL_Copy=Copy
3.14 LBL_Export=Export as HTML ...
3.15 +LBL_Print_Preview=Print Preview ...
3.16 LBL_Previous_Occurence=Previous Occurence
3.17 LBL_Next_Occurence=Next Occurence
3.18 LBL_Collapse_Expand=Collapse / Expand
3.19 @@ -75,8 +76,8 @@
3.20 CTL_Search_Results_Tooltip=Search Results
3.21 TLT_Expose=Collapse / Expand
3.22 TLT_Export=Export as HTML
3.23 -TLT_Previous_Occurence=Previous Occurence (Shift+F12)
3.24 -TLT_Next_Occurence=Next Occurence (F12)
3.25 +TLT_Previous_Occurence=Previous Occurence - Shift+F12
3.26 +TLT_Next_Occurence=Next Occurence - F12
3.27
3.28 # Export
3.29 # {0} - file name
4.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Tree.java Fri Oct 05 13:50:51 2007 +0000
4.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Tree.java Fri Oct 05 13:55:31 2007 +0000
4.3 @@ -40,11 +40,6 @@
4.4 */
4.5 package org.netbeans.modules.bpel.search.impl.ui;
4.6
4.7 -import java.util.ArrayList;
4.8 -import java.util.Enumeration;
4.9 -import java.util.Iterator;
4.10 -import java.util.List;
4.11 -
4.12 import java.awt.Component;
4.13 import java.awt.Dimension;
4.14 import java.awt.Toolkit;
4.15 @@ -57,6 +52,13 @@
4.16 import java.awt.event.MouseAdapter;
4.17 import java.awt.event.MouseEvent;
4.18
4.19 +import java.util.ArrayList;
4.20 +import java.util.Enumeration;
4.21 +import java.util.Iterator;
4.22 +import java.util.List;
4.23 +
4.24 +import javax.swing.Action;
4.25 +import javax.swing.Icon;
4.26 import javax.swing.JMenuItem;
4.27 import javax.swing.JPopupMenu;
4.28 import javax.swing.JTree;
4.29 @@ -75,6 +77,7 @@
4.30 import javax.swing.tree.TreeSelectionModel;
4.31
4.32 import org.openide.windows.WindowManager;
4.33 +import org.netbeans.modules.print.api.PrintManager;
4.34 import org.netbeans.modules.xml.search.api.SearchElement;
4.35 import org.netbeans.modules.xml.search.api.SearchEvent;
4.36 import org.netbeans.modules.xml.search.spi.SearchListener;
4.37 @@ -213,34 +216,15 @@
4.38 }
4.39
4.40 private void handleAction(int code, int modifiers, DefaultMutableTreeNode node) {
4.41 -// if (code == KeyEvent.VK_D && isAlt(modifiers)) {
4.42 -// select(node);
4.43 -// }
4.44 -// else if (code == KeyEvent.VK_O && isAlt(modifiers)) {
4.45 -// gotoSource(node);
4.46 -// }
4.47 -// else
4.48 if (code == KeyEvent.VK_C && isCtrl(modifiers)) {
4.49 copy(node);
4.50 }
4.51 -// else if (code == KeyEvent.VK_H && isCtrl(modifiers)) {
4.52 -// export(node);
4.53 -// }
4.54 - else {
4.55 - handleResult(code, modifiers, node);
4.56 - }
4.57 - }
4.58 -
4.59 - private void handleResult(int code, int modifiers, DefaultMutableTreeNode node) {
4.60 - if (code == KeyEvent.VK_F12 && isShift(modifiers)) {
4.61 + else if (code == KeyEvent.VK_F12 && isShift(modifiers)) {
4.62 previousOccurence(node);
4.63 }
4.64 else if (code == KeyEvent.VK_F12) {
4.65 nextOccurence(node);
4.66 }
4.67 -// else if (code == KeyEvent.VK_E && isCtrl(modifiers)) {
4.68 -// expose(node);
4.69 -// }
4.70 else if (code == KeyEvent.VK_DELETE) {
4.71 remove(node);
4.72 }
4.73 @@ -255,9 +239,24 @@
4.74
4.75 popup.addSeparator(); // -----------------------------------------------------
4.76
4.77 + // remove
4.78 + item = createItem("LBL_Remove"); // NOI18N
4.79 + item.setEnabled( !node.isRoot());
4.80 + item.setIcon(EMPTY);
4.81 + item.addActionListener(new ActionListener() {
4.82 + public void actionPerformed(ActionEvent event) {
4.83 + remove(node);
4.84 + }
4.85 + });
4.86 + item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
4.87 + popup.add(item);
4.88 +
4.89 + popup.addSeparator(); // -----------------------------------------------------
4.90 +
4.91 // previous occurence
4.92 item = createItem("LBL_Previous_Occurence"); // NOI18N
4.93 item.setEnabled(true);
4.94 + item.setIcon(icon(Util.class, "previous")); // NOI18N
4.95 item.addActionListener(new ActionListener() {
4.96 public void actionPerformed(ActionEvent event) {
4.97 previousOccurence(node);
4.98 @@ -269,6 +268,7 @@
4.99 // next occurence
4.100 item = createItem("LBL_Next_Occurence"); // NOI18N
4.101 item.setEnabled(true);
4.102 + item.setIcon(icon(Util.class, "next")); // NOI18N
4.103 item.addActionListener(new ActionListener() {
4.104 public void actionPerformed(ActionEvent event) {
4.105 nextOccurence(node);
4.106 @@ -279,26 +279,28 @@
4.107
4.108 popup.addSeparator(); // -----------------------------------------------------
4.109
4.110 - // collapse / expand
4.111 - item = createItem("LBL_Collapse_Expand"); // NOI18N
4.112 - item.setEnabled( !node.isLeaf());
4.113 + // vlv: print
4.114 + item = createItem("LBL_Print_Preview"); // NOI18N
4.115 + item.setEnabled(true);
4.116 + item.setIcon(getPrintPreviewIcon());
4.117 item.addActionListener(new ActionListener() {
4.118 public void actionPerformed(ActionEvent event) {
4.119 - expose(node);
4.120 + PrintManager.getPrintPreviewAction().actionPerformed(event);
4.121 }
4.122 });
4.123 -// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK));
4.124 + item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P,
4.125 + KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK
4.126 + ));
4.127 popup.add(item);
4.128
4.129 - // remove
4.130 - item = createItem("LBL_Remove"); // NOI18N
4.131 - item.setEnabled( !node.isRoot());
4.132 + // export
4.133 + item = createItem("LBL_Export"); // NOI18N
4.134 + item.setIcon(icon(Util.class, "export")); // NOI18N
4.135 item.addActionListener(new ActionListener() {
4.136 public void actionPerformed(ActionEvent event) {
4.137 - remove(node);
4.138 + export(node);
4.139 }
4.140 });
4.141 - item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
4.142 popup.add(item);
4.143
4.144 // show
4.145 @@ -308,30 +310,31 @@
4.146 private void createAction(JPopupMenu popup, final DefaultMutableTreeNode node) {
4.147 JMenuItem item;
4.148
4.149 - // select
4.150 + // go to design
4.151 item = createItem("LBL_Select"); // NOI18N
4.152 item.setEnabled( !node.isRoot());
4.153 + item.setIcon(EMPTY);
4.154 item.addActionListener(new ActionListener() {
4.155 public void actionPerformed(ActionEvent event) {
4.156 select(node);
4.157 }
4.158 });
4.159 -// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.ALT_MASK));
4.160 popup.add(item);
4.161
4.162 // go to source
4.163 item = createItem("LBL_Go_to_Source"); // NOI18N
4.164 item.setEnabled( !node.isRoot());
4.165 + item.setIcon(EMPTY);
4.166 item.addActionListener(new ActionListener() {
4.167 public void actionPerformed(ActionEvent event) {
4.168 gotoSource(node);
4.169 }
4.170 });
4.171 -// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.ALT_MASK));
4.172 popup.add(item);
4.173
4.174 // copy
4.175 item = createItem("LBL_Copy"); // NOI18N
4.176 + item.setIcon(icon(Util.class, "copy")); // NOI18N
4.177 item.addActionListener(new ActionListener() {
4.178 public void actionPerformed(ActionEvent event) {
4.179 copy(node);
4.180 @@ -340,17 +343,27 @@
4.181 item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
4.182 popup.add(item);
4.183
4.184 - // export
4.185 - item = createItem("LBL_Export"); // NOI18N
4.186 + // collapse / expand
4.187 + item = createItem("LBL_Collapse_Expand"); // NOI18N
4.188 + item.setEnabled( !node.isLeaf());
4.189 + item.setIcon(icon(Util.class, "expose")); // NOI18N
4.190 item.addActionListener(new ActionListener() {
4.191 public void actionPerformed(ActionEvent event) {
4.192 - export(node);
4.193 + expose(node);
4.194 }
4.195 });
4.196 -// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK));
4.197 popup.add(item);
4.198 }
4.199
4.200 + private Icon getPrintPreviewIcon() {
4.201 + Object object = PrintManager.getPrintPreviewAction().getValue(Action.SMALL_ICON);
4.202 +
4.203 + if (object instanceof Icon) {
4.204 + return (Icon) object;
4.205 + }
4.206 + return EMPTY;
4.207 + }
4.208 +
4.209 private boolean isAlt(int modifiers) {
4.210 return isModifier(modifiers, KeyEvent.ALT_MASK);
4.211 }
4.212 @@ -486,7 +499,7 @@
4.213 TreePath path = new TreePath(node.getPath());
4.214 boolean isExpanded = isExpanded(path);
4.215
4.216 - // for root special check
4.217 + // special check for root
4.218 if (node.isRoot()) {
4.219 Enumeration children = node.children();
4.220 isExpanded = false;
4.221 @@ -662,15 +675,26 @@
4.222 JTree tree, Object value, boolean select, boolean expanded,
4.223 boolean leaf, int row, boolean focus)
4.224 {
4.225 - super.getTreeCellRendererComponent(
4.226 - tree, value, select, expanded, leaf, row, focus);
4.227 + super.getTreeCellRendererComponent(tree, value, select, expanded, leaf, row, focus);
4.228 SearchElement element =
4.229 (SearchElement) ((DefaultMutableTreeNode) value).getUserObject();
4.230 - setText(element.getName());
4.231 +
4.232 + setText("<html>" + getHtmlName(element.getName(), leaf, row) + "</html>"); // NOI18N
4.233 setToolTipText(element.getToolTip());
4.234 setIcon(element.getIcon());
4.235 +
4.236 return this;
4.237 }
4.238 +
4.239 + private String getHtmlName(String name, boolean leaf, int row) {
4.240 + if (row == 0) {
4.241 + return name;
4.242 + }
4.243 + if (leaf) {
4.244 + return "<b>" + name + "</b>"; // NOI18N
4.245 + }
4.246 + return "<font color=\"#999999\">" + name + "</font>"; // NOI18N
4.247 + }
4.248 }
4.249
4.250 private int myIndex;
4.251 @@ -679,4 +703,5 @@
4.252 private boolean myIsReformAll;
4.253 private DefaultMutableTreeNode myRoot;
4.254 private List<DefaultMutableTreeNode> myOccurences;
4.255 + private static final Icon EMPTY = icon(Util.class, "empty"); // NOI18N
4.256 }
5.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/View.java Fri Oct 05 13:50:51 2007 +0000
5.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/View.java Fri Oct 05 13:55:31 2007 +0000
5.3 @@ -111,24 +111,6 @@
5.4 setSize(button);
5.5 toolBar.add(button);
5.6
5.7 - // export
5.8 - button = createButton(
5.9 - new ButtonAction(
5.10 - icon(Util.class, "export"), // NOI18N
5.11 - i18n(View.class, "TLT_Export")) { // NOI18N
5.12 - public void actionPerformed(ActionEvent event) {
5.13 - myTree.export(myTree.getSelectedNode());
5.14 - }
5.15 - }
5.16 - );
5.17 - setSize(button);
5.18 - toolBar.add(button);
5.19 -
5.20 - // vlv: print
5.21 - button = createButton(PrintManager.getPrintPreviewAction());
5.22 - setSize(button);
5.23 - toolBar.add(button);
5.24 -
5.25 // previous occurence
5.26 button = createButton(
5.27 new ButtonAction(
5.28 @@ -155,6 +137,24 @@
5.29 setSize(button);
5.30 toolBar.add(button);
5.31
5.32 + // vlv: print
5.33 + button = createButton(PrintManager.getPrintPreviewAction());
5.34 + setSize(button);
5.35 + toolBar.add(button);
5.36 +
5.37 + // export
5.38 + button = createButton(
5.39 + new ButtonAction(
5.40 + icon(Util.class, "export"), // NOI18N
5.41 + i18n(View.class, "TLT_Export")) { // NOI18N
5.42 + public void actionPerformed(ActionEvent event) {
5.43 + myTree.export(myTree.getSelectedNode());
5.44 + }
5.45 + }
5.46 + );
5.47 + setSize(button);
5.48 + toolBar.add(button);
5.49 +
5.50 return toolBar;
5.51 }
5.52