This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 217115
Collapse All | Expand All

(-)a/api.search/src/org/netbeans/modules/search/ui/MatchingObjectNode.java (+17 lines)
Lines 56-61 Link Here
56
import java.io.IOException;
56
import java.io.IOException;
57
import java.lang.reflect.InvocationTargetException;
57
import java.lang.reflect.InvocationTargetException;
58
import java.util.List;
58
import java.util.List;
59
import java.util.logging.Level;
60
import java.util.logging.Logger;
59
import javax.swing.AbstractAction;
61
import javax.swing.AbstractAction;
60
import javax.swing.Action;
62
import javax.swing.Action;
61
import org.netbeans.api.annotations.common.StaticResource;
63
import org.netbeans.api.annotations.common.StaticResource;
Lines 80-85 Link Here
80
 */
82
 */
81
public class MatchingObjectNode extends AbstractNode {
83
public class MatchingObjectNode extends AbstractNode {
82
84
85
    Logger LOG = Logger.getLogger(MatchingObjectNode.class.getName());
86
83
    @StaticResource
87
    @StaticResource
84
    private static final String INVALID_ICON =
88
    private static final String INVALID_ICON =
85
            "org/netbeans/modules/search/res/invalid.png";              //NOI18N
89
            "org/netbeans/modules/search/res/invalid.png";              //NOI18N
Lines 334-339 Link Here
334
            File f = FileUtil.toFile(
338
            File f = FileUtil.toFile(
335
                    matchingObject.getFileObject());
339
                    matchingObject.getFileObject());
336
            if (f != null) {
340
            if (f != null) {
341
                LOG.log(Level.INFO, "Copying path of file {0}", //REM //NOI18N 
342
                        f.getPath());
337
                String path = f.getPath();
343
                String path = f.getPath();
338
                Toolkit toolkit = Toolkit.getDefaultToolkit();
344
                Toolkit toolkit = Toolkit.getDefaultToolkit();
339
                if (toolkit != null) {
345
                if (toolkit != null) {
Lines 341-348 Link Here
341
                    if (clipboard != null) {
347
                    if (clipboard != null) {
342
                        StringSelection strSel = new StringSelection(path);
348
                        StringSelection strSel = new StringSelection(path);
343
                        clipboard.setContents(strSel, null);
349
                        clipboard.setContents(strSel, null);
350
                        LOG.log(Level.INFO,
351
                                "Setting clipboard content: {0}", //NOI18N
352
                                path); //REM
353
                    } else {
354
                        LOG.warning("Clipboard is null"); //REM         //NOI18N
344
                    }
355
                    }
356
                } else {
357
                    LOG.warning("Toolkit is null"); //REM               //NOI18N
345
                }
358
                }
359
            } else {
360
                LOG.log(Level.WARNING,
361
                        "Warning: FileObject is null: {0}", //NOI18N
362
                        matchingObject); //REM
346
            }
363
            }
347
        }
364
        }
348
    }
365
    }
(-)a/api.search/src/org/netbeans/modules/search/ui/OpenMatchingObjectsAction.java (-1 / +17 lines)
Lines 41-46 Link Here
41
 */
41
 */
42
package org.netbeans.modules.search.ui;
42
package org.netbeans.modules.search.ui;
43
43
44
import java.util.logging.Level;
45
import java.util.logging.Logger;
44
import org.netbeans.modules.search.MatchingObject;
46
import org.netbeans.modules.search.MatchingObject;
45
import org.openide.cookies.EditCookie;
47
import org.openide.cookies.EditCookie;
46
import org.openide.loaders.DataObject;
48
import org.openide.loaders.DataObject;
Lines 55-60 Link Here
55
 */
57
 */
56
public class OpenMatchingObjectsAction extends NodeAction {
58
public class OpenMatchingObjectsAction extends NodeAction {
57
59
60
    Logger LOG = Logger.getLogger(OpenMatchingObjectsAction.class.getName());
61
58
    @Override
62
    @Override
59
    public String getName() {
63
    public String getName() {
60
        return UiUtils.getText("LBL_EditAction");                       //NOI18N
64
        return UiUtils.getText("LBL_EditAction");                       //NOI18N
Lines 68-73 Link Here
68
    @Override
72
    @Override
69
    protected void performAction(Node[] activatedNodes) {
73
    protected void performAction(Node[] activatedNodes) {
70
74
75
        LOG.log(Level.INFO, "Opening {0} activated node(s)", //NOI18N
76
                activatedNodes.length);
71
        for (Node n : activatedNodes) {
77
        for (Node n : activatedNodes) {
72
            MatchingObject mo = n.getLookup().lookup(
78
            MatchingObject mo = n.getLookup().lookup(
73
                    MatchingObject.class);
79
                    MatchingObject.class);
Lines 75-85 Link Here
75
                DataObject dob = mo.getDataObject();
81
                DataObject dob = mo.getDataObject();
76
                if (dob != null) {
82
                if (dob != null) {
77
                    EditCookie editCookie = dob.getLookup().lookup(
83
                    EditCookie editCookie = dob.getLookup().lookup(
78
                            EditCookie.class);
84
                            EditCookie.class);                    
79
                    if (editCookie != null) {
85
                    if (editCookie != null) {
86
                        LOG.log(Level.INFO, "Opening EditCookie in {0}",//NOI18N
87
                                dob);
80
                        editCookie.edit();
88
                        editCookie.edit();
89
                    } else {
90
                        LOG.log(Level.WARNING, "No EditCookie in {0}", //NOI18N
91
                                dob);
81
                    }
92
                    }
93
                } else {
94
                    LOG.log(Level.WARNING, "No DataObject in {0}", mo); //NOI18N
82
                }
95
                }
96
            } else {
97
                LOG.log(Level.WARNING, "No MatchingObject in node {0}", //NOI18N
98
                        n.getDisplayName());
83
            }
99
            }
84
        }
100
        }
85
    }
101
    }

Return to bug 217115