Java Code Examples for org.openide.util.Pair#second()

The following examples show how to use org.openide.util.Pair#second() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NBJRTURLMapper.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public FileObject[] getFileObjects(URL url) {
    final Pair<URL,String> parsed = NBJRTUtil.parseURL(url);
    if (parsed != null) {
        final URL root = parsed.first();
        final String pathInImage = parsed.second();
        FileSystem fs = NBJRTFileSystemProvider.getDefault().getFileSystem(root);
        if (fs != null) {
            final FileObject fo = fs.getRoot().getFileObject(pathInImage);
            if (fo != null) {
                return new FileObject[]{
                    fo
                };
            }
        }
    }
    return null;
}
 
Example 2
Source File: UnusedAssignmentOrBranch.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Hint(displayName = "#DN_org.netbeans.modules.java.hints.bugs.UnusedAssignmentOrBranch.unusedAssignment", description = "#DESC_org.netbeans.modules.java.hints.bugs.UnusedAssignmentOrBranch.unusedAssignment", category="bugs", id=UNUSED_ASSIGNMENT_ID, options={Options.QUERY}, suppressWarnings="UnusedAssignment")
@TriggerPatterns({
    @TriggerPattern("$var = $value"),
    @TriggerPattern("$mods$ $type $var = $value;")
})
public static ErrorDescription unusedAssignment(final HintContext ctx) {
    final String unusedAssignmentLabel = NbBundle.getMessage(UnusedAssignmentOrBranch.class, "LBL_UNUSED_ASSIGNMENT_LABEL");
    Pair<Set<Tree>, Set<Element>> computedAssignments = computeUsedAssignments(ctx);
    
    if (ctx.isCanceled() || computedAssignments == null) return null;

    final CompilationInfo info = ctx.getInfo();
    final Set<Tree> usedAssignments = computedAssignments.first();
    final Set<Element> usedVariables = computedAssignments.second();
    Element var = info.getTrees().getElement(ctx.getVariables().get("$var"));
    TreePath valuePath = ctx.getVariables().get("$value");
    Tree value = (valuePath == null ? ctx.getPath() : valuePath).getLeaf();

    if (var != null && LOCAL_VARIABLES.contains(var.getKind()) && !usedAssignments.contains(value) && usedVariables.contains(var)) {
        return ErrorDescriptionFactory.forTree(ctx, value, unusedAssignmentLabel);
    }

    return null;
}
 
Example 3
Source File: PlatformNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public String getHtmlDisplayName () {
    final Pair<String,JavaPlatform> platHolder = pp.getPlatform();
    if (platHolder == null) {
        return null;
    }
    final JavaPlatform jp = platHolder.second();
    if (jp == null || !jp.isValid()) {
        String displayName = this.getDisplayName();
        try {
            displayName = XMLUtil.toElementContent(displayName);
        } catch (CharConversionException ex) {
            // OK, no annotation in this case
            return null;
        }
        return "<font color=\"#A40000\">" + displayName + "</font>"; //NOI18N
    } else {
        return null;
    }
}
 
Example 4
Source File: DefaultCssModuleTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testGetDeclarationForImport() {
    BaseDocument document = getDocument("@import \"hello.css\"; ");
    //                                   01234567 8901234567 8901
    //                                   0         1         2         3
    DefaultCssEditorModule dm = new DefaultCssEditorModule();
    Pair<OffsetRange, FutureParamTask<DeclarationFinder.DeclarationLocation, EditorFeatureContext>> declaration = dm.getDeclaration(document, 10);
    assertNotNull(declaration);
    OffsetRange range = declaration.first();
    assertNotNull(range);
    assertEquals(9, range.getStart());
    assertEquals(18, range.getEnd());
    
    FutureParamTask<DeclarationFinder.DeclarationLocation, EditorFeatureContext> task = declaration.second();
    assertNotNull(task);
    
}
 
Example 5
Source File: CachingArchiveProvider.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Checks if the given boot classpath root has the the ct.sym equivalent.
 * @param root the root to check
 * @return true if there is a ct.sym folder corresponding to given boot classpath
 * root
 */
public boolean hasCtSym (@NonNull final URL root) {
    final URL fileURL = FileUtil.getArchiveFile(root);
    if (fileURL == null) {
        return false;
    }
    final File f;
    try {
        f = BaseUtilities.toFile(fileURL.toURI());
    } catch (URISyntaxException ex) {
        return false;
    }
    if (f == null || !f.exists()) {
        return false;
    }
    final Pair<File, String> res = mapJarToCtSym(f);
    return res.second() != null;

}
 
Example 6
Source File: ScanStartedTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    final String msg = record.getMessage();
    final Pair<String,RuntimeException> ie  = internalException;
    if (ie != null &&
        msg != null &&
        msg.startsWith("scanStarting:") &&  //NOI18N
        ie.first().equals(record.getParameters()[0])) {
        throw ie.second();
    } else {
        super.publish(record);
    }
}
 
Example 7
Source File: LayeredDocumentIndex.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Collection<? extends IndexDocument> findByPrimaryKey(String primaryKeyValue, QueryKind kind, String... fieldsToLoad) throws IOException, InterruptedException {
    final Collection<? extends IndexDocument> br = base.findByPrimaryKey(primaryKeyValue, kind, fieldsToLoad);
    final Pair<DocumentIndex2,Set<String>> ovl = getOverlayIfExists();
    if (ovl.first() == null) {
        return ovl.second() == null ? br : Filter.filter(br, ovl.second());
    } else {
        return new ProxyCollection<IndexDocument>(
            ovl.second() == null ? br : Filter.filter(br,ovl.second()),
            ovl.first().findByPrimaryKey(primaryKeyValue, kind, fieldsToLoad));
    }
}
 
Example 8
Source File: LibrariesNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@NonNull
public Collection<SourceGroup> apply(@NonNull final Pair<File,Collection<? super URL>> param) {
    final File file = param.first();
    final Collection<? super URL> rootsList = param.second();
    final SourceGroup sg = createFileSourceGroup(file,rootsList);
    return sg != null ?
            Collections.singleton(sg) :
            Collections.emptySet();
}
 
Example 9
Source File: MRJARCachingFileManagerTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static File createMultiReleaseJar(
        @NonNull final File loc,
        final boolean hasMultiVersionAttr,
        @NonNull final Collection<Pair<String,Collection<Integer>>> spec) throws IOException {
    final Manifest mf = new Manifest();
    final Attributes attrs = mf.getMainAttributes();
    attrs.put(Attributes.Name.MANIFEST_VERSION, "1.0"); //NOI18N
    if (hasMultiVersionAttr) {
        attrs.putValue(
                "Multi-Release",      //NOI18N
                Boolean.TRUE.toString());
    }
    try (JarOutputStream jar = new JarOutputStream(new FileOutputStream(loc), mf)) {
        for (Pair<String,Collection<Integer>> p : spec) {
            final String fqn = p.first();
            final Collection<Integer> versions = p.second();
            final String path = FileObjects.convertPackage2Folder(fqn) + ".class";  //NOI18N
            final String name = FileObjects.getBaseName(fqn,'.');                   //NOI18N
            final Collection<String[]> prefixes = new ArrayList<>();
            for (Integer version : versions) {
                if (version == 0) {
                    prefixes.add(new String[]{"","Base"});                  //NOI18N
                } else {
                    prefixes.add(new String[]{"META-INF/versions/"+version, version.toString()});   //NOI18N
                }
            }
            for (String[] prefix : prefixes) {
                final String pathWithScope = prefix[0].isEmpty() ?
                        path :
                        String.format("%s/%s", prefix[0], path);            //NOI18N
                jar.putNextEntry(new ZipEntry(pathWithScope));
                jar.write(String.format("%s %s", name, prefix[1]).getBytes(Charset.forName("UTF-8")));  //NOI18N
                jar.closeEntry();
            }
        }
    }
    return loc;
}
 
Example 10
Source File: PlatformNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void edit() {
    final Pair<String,JavaPlatform> platHolder = pp.getPlatform();
    if (platHolder != null && platHolder.second() != null) {
        PlatformsCustomizer.showCustomizer(platHolder.second());
    }
}
 
Example 11
Source File: BootCPNodeFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public String getShortDescription() {
    final Pair<String,JavaPlatform> platHolder = pp.getPlatform();
    if (platHolder != null && platHolder.second() != null && !platHolder.second().getInstallFolders().isEmpty()) {
        final FileObject installFolder = platHolder.second().getInstallFolders().iterator().next();
        return FileUtil.getFileDisplayName(installFolder);
    } else {
        return super.getShortDescription();
    }
}
 
Example 12
Source File: BootCPNodeFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NonNull
public FileObject[] getBootstrapLibraries() {
    final Pair<String, JavaPlatform> jp = getPlatform();
    if (jp == null || jp.second() == null) {
        return new FileObject[0];
    }
    ClassPath cp = boot;
    if (cp == null) {
        cp = jp.second().getBootstrapLibraries();
    }
    return cp.getRoots();
}
 
Example 13
Source File: PhpExecutable.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Parse command which can be just binary or binary with parameters.
 * As a parameter separator, "-" or "/" is used.
 * @param command command to parse, can be {@code null}.
 */
public PhpExecutable(String command) {
    Pair<String, List<String>> parsedCommand = parseCommand(command);
    executable = parsedCommand.first();
    parameters = parsedCommand.second();
    this.command = command.trim();
}
 
Example 14
Source File: BuildScriptsNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Messages({
    "LBL_ProjectSuffixt=project",
    "LBL_RootSuffix=root",
    "LBL_UserSuffix=user"
})
@Override
protected Node createNodeForKey(Pair<FileObject, GradleFiles.Kind> key) {
    // Do not show root script and property nodes on root project.
    boolean isRoot = project.getGradleProject().getBaseProject().isRoot();
    if (isRoot
            && ((key.second() == GradleFiles.Kind.ROOT_SCRIPT)
            || (key.second() == GradleFiles.Kind.ROOT_PROPERTIES))) {
        return null;
    }
    try {
        Node node = DataObject.find(key.first()).getNodeDelegate().cloneNode();
        String nameSuffix = null;
        if (key.second() != null) {
            if (key.second() == GradleFiles.Kind.USER_PROPERTIES) {
                nameSuffix = Bundle.LBL_UserSuffix();
            }
            if (!isRoot) {
                switch (key.second()) {
                    case BUILD_SCRIPT:
                    case PROJECT_PROPERTIES: {
                        nameSuffix = Bundle.LBL_ProjectSuffixt();
                        break;
                    }
                    case ROOT_SCRIPT:
                    case ROOT_PROPERTIES: {
                        nameSuffix = Bundle.LBL_RootSuffix();
                        break;
                    }
                }
            }
        }
        if (nameSuffix != null) {
            node.setDisplayName(key.first().getNameExt() + " [" + nameSuffix + "]");
        }
        return node;
    } catch (DataObjectNotFoundException e) {
        return null;
    }
}
 
Example 15
Source File: HintsUI.java    From netbeans with Apache License 2.0 4 votes vote down vote up
boolean invokeDefaultAction(boolean onlyActive) {
    JTextComponent comp = getComponent();
    if (comp == null) {
        Logger.getLogger(HintsUI.class.getName()).log(Level.WARNING, "HintsUI.invokeDefaultAction called, but comp == null");
        return false;
    }

    Document doc = comp.getDocument();

    cancel.set(false);
    
    if (doc instanceof BaseDocument) {
        try {
            Rectangle carretRectangle = comp.modelToView(comp.getCaretPosition());
            int line = Utilities.getLineOffset((BaseDocument) doc, comp.getCaretPosition());
            FixData fixes;
            String description;

            if (!onlyActive) {
                refresh(doc, comp.getCaretPosition());
                AnnotationHolder holder = getAnnotationHolder(doc);
                Pair<FixData, String> fixData = holder != null ? holder.buildUpFixDataForLine(line) : null;

                if (fixData == null) return false;

                fixes = fixData.first();
                description = fixData.second();
            } else {
                AnnotationDesc activeAnnotation = ((BaseDocument) doc).getAnnotations().getActiveAnnotation(line);
                if (activeAnnotation == null) {
                    return false;
                }
                String type = activeAnnotation.getAnnotationType();
                if (!FixAction.getFixableAnnotationTypes().contains(type) && onlyActive) {
                    return false;
                }
                if (onlyActive) {
                    refresh(doc, comp.getCaretPosition());
                }
                Annotations annotations = ((BaseDocument) doc).getAnnotations();
                AnnotationDesc desc = annotations.getAnnotation(line, type);
                ParseErrorAnnotation annotation = null;
                if (desc != null) {
                    annotations.frontAnnotation(desc);
                    annotation = findAnnotation(doc, desc, line);
                }

                if (annotation == null) {
                    return false;
                }
                
                fixes = annotation.getFixes();
                description = annotation.getDescription();
            }

            Point p = comp.modelToView(Utilities.getRowStartFromLineOffset((BaseDocument) doc, line)).getLocation();
            p.y += carretRectangle.height;
            if(comp.getParent() instanceof JViewport) {
                p.x += ((JViewport)comp.getParent()).getViewPosition().x;
            }
            if(comp.getParent() instanceof JLayeredPane &&
                    comp.getParent().getParent() instanceof JViewport) {
                p.x += ((JViewport)comp.getParent().getParent()).getViewPosition().x;
            }

            showPopup(fixes, description, comp, p);

            return true;
        } catch (BadLocationException ex) {
            ErrorManager.getDefault().notify(ex);
        }
    }

    return false;
}
 
Example 16
Source File: URIMapper.java    From netbeans with Apache License 2.0 4 votes vote down vote up
static URIMapper.MultiMapper createMultiMapper(URI webServerURI, FileObject sourceFileObj,
        FileObject sourceRoot, List<Pair<String, String>> pathMapping) {
    //typicaly should be mappers called in this order:
    //- 1. mapper provided by user via project UI if any
    //- 2. base mapper
    //- 3. last resort mapper (one to one mapper)
    //TODO: we could also implement mapper with UI asking the user to add info for
    //mapping instead of lsat resort mapper implemented by one to one
    MultiMapper mergedMapper = new MultiMapper();
    for (Pair<String, String> pair : pathMapping) {
        //1. mapper provided by user via project UI if any
        pair = encodedPathMappingPair(pair);
        String uriPath = pair.first();
        String filePath = pair.second();
        if (uriPath.length() > 0 && filePath.length() > 0) {
            if (!uriPath.startsWith("file:")) { //NOI18N
                if (!uriPath.startsWith("/")) {
                    uriPath = "file:/" + uriPath; //NOI18N
                } else {
                    uriPath = "file:" + uriPath; //NOI18N
                }
            }
            if (!uriPath.endsWith("/")) { //NOI18N
                uriPath += "/"; //NOI18N
            }
            URI remoteURI = URI.create(uriPath);
            File localFile = new File(filePath);
            FileObject localFo = FileUtil.toFileObject(localFile);
            if (localFo != null && localFo.isFolder()) {
                URIMapper customMapper = URIMapper.createBasedInstance(remoteURI, localFile);
                mergedMapper.addAsLastMapper(customMapper);
            }
        }
    }

    //2. base mapper that checks sourceFileObj && webServerURI to create webServerURIBase and  sourceFileObjBase
    //used for conversions
    URIMapper defaultMapper = createDefaultMapper(webServerURI, sourceFileObj, sourceRoot);
    if (defaultMapper != null) {
        mergedMapper.addAsLastMapper(defaultMapper);
    }
    //3. last resort just one to one mapper (should be called as last)
    mergedMapper.addAsLastMapper(createOneToOne());

    return mergedMapper;
}
 
Example 17
Source File: ConvertVisibilitySuggestion.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public List<HintFix> createFixes(BaseDocument document) {
    ArrayList<HintFix> fixes = new ArrayList<>();
    Pair<String, OffsetRange> visibilityRange = getVisibilityRange(document);
    String visibility = visibilityRange.first();
    OffsetRange range = visibilityRange.second();
    switch (visibility) {
        case "implicit": // NOI18N
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PUBLIC + " ", document)); // NOI18N
            if (!isInInterface) {
                if (!isAbstract) {
                    fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PRIVATE + " ", document)); // NOI18N
                }
                fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PROTECTED + " ", document)); // NOI18N
            }
            break;
        case PhpModifiers.VISIBILITY_VAR:
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PUBLIC, document));
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PRIVATE, document));
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PROTECTED, document));
            break;
        case PhpModifiers.VISIBILITY_PUBLIC:
            if (!isInInterface) {
                if (!isAbstract) {
                    fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PRIVATE, document));
                }
                fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PROTECTED, document));
            }
            break;
        case PhpModifiers.VISIBILITY_PRIVATE:
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PUBLIC, document));
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PROTECTED, document));
            break;
        case PhpModifiers.VISIBILITY_PROTECTED:
            fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PUBLIC, document));
            if (!isAbstract) {
                fixes.add(new Fix(range, PhpModifiers.VISIBILITY_PRIVATE, document));
            }
            break;
        default:
            break;
    }
    return fixes;
}
 
Example 18
Source File: DocumentUtil.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Query convert(Pair<String, String> p) {
    final String resourceName = p.first();
    final String sourceName = p.second();
    return fileBased ? createClassesInFileQuery(resourceName,sourceName) : createClassWithEnclosedQuery(resourceName, sourceName);
}
 
Example 19
Source File: UnusedAssignmentOrBranch.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Hint(displayName = "#DN_org.netbeans.modules.java.hints.bugs.UnusedAssignmentOrBranch.unusedCompoundAssignment", 
        description = "#DESC_org.netbeans.modules.java.hints.bugs.UnusedAssignmentOrBranch.unusedCompoundAssignment", 
        category="bugs", 
        id=UNUSED_COMPOUND_ASSIGNMENT_ID, 
        options={Options.QUERY}, suppressWarnings="UnusedAssignment")
@TriggerPatterns({
    @TriggerPattern("$var |= $expr"),
    @TriggerPattern("$var &= $expr"),
    @TriggerPattern("$var += $expr"),
    @TriggerPattern("$var -= $expr"),
    @TriggerPattern("$var *= $expr"),
    @TriggerPattern("$var /= $expr"),
    @TriggerPattern("$var %= $expr"),
    @TriggerPattern("$var >>= $expr"),
    @TriggerPattern("$var <<= $expr"),
    @TriggerPattern("$var >>>= $expr")
})
@NbBundle.Messages({
    "LBL_UnusedCompoundAssignmentLabel=The target variable's value is never used",
    "FIX_ChangeCompoundAssignmentToOperation=Change compound assignment to operation"
})
public static ErrorDescription unusedCompoundAssignment(final HintContext ctx) {
    final String unusedAssignmentLabel = Bundle.LBL_UnusedCompoundAssignmentLabel();
    Pair<Set<Tree>, Set<Element>> computedAssignments = computeUsedAssignments(ctx);
    
    if (ctx.isCanceled() || computedAssignments == null) return null;

    final CompilationInfo info = ctx.getInfo();
    final Set<Tree> usedAssignments = computedAssignments.first();
    final Set<Element> usedVariables = computedAssignments.second();
    final Element var = info.getTrees().getElement(ctx.getVariables().get("$var")); // NOI18N
    final TreePath valuePath = ctx.getVariables().get("$expr"); // NOI18N
    final Tree value = ctx.getPath().getLeaf();
    final TypeMirror tm = info.getTrees().getTypeMirror(ctx.getPath());
    final boolean sideEffects;
    final boolean booleanOp = Utilities.isValidType(tm) && tm.getKind() == TypeKind.BOOLEAN;
    Tree.Kind kind = value.getKind();
    if (booleanOp) {
        sideEffects = mayHaveSideEffects(ctx, valuePath);
    } else {
        sideEffects = false;
    }

    if (var != null && LOCAL_VARIABLES.contains(var.getKind()) && !usedAssignments.contains(value) && usedVariables.contains(var)) {
        String replace;
        switch (kind) {
            case AND_ASSIGNMENT:
                if (booleanOp) {
                    replace = sideEffects ? "$expr && $var" : "$var && $expr"; // NOI18N
                } else {
                    replace = "$var & $expr"; // NOI18N
                }
                break;
            case OR_ASSIGNMENT:
                if (booleanOp) {
                    replace = sideEffects ? "$expr || $var" : "$var || $expr"; // NOI18N
                } else {
                    replace = "$var | $expr"; // NOI18N
                }
                break;
            case PLUS_ASSIGNMENT:
                replace = "$var + $expr"; // NOI18N
                break;
            case MINUS_ASSIGNMENT:
                replace = "$var - $expr"; // NOI18N
                break;
            case MULTIPLY_ASSIGNMENT:
                replace = "$var * $expr"; // NOI18N
                break;
            case DIVIDE_ASSIGNMENT:
                replace = "$var / $expr"; // NOI18N
                break;
            case REMAINDER_ASSIGNMENT:
                replace = "$var % $expr"; // NOI18N
                break;
            case LEFT_SHIFT_ASSIGNMENT:
                replace = "$var << $expr"; // NOI18N
                break;
            case RIGHT_SHIFT_ASSIGNMENT:
                replace = "$var >> $expr"; // NOI18N
                break;
            case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT:
                replace = "$var >>> $expr"; // NOI18N
                break;
            default:
                return null;
        }
        
        return ErrorDescriptionFactory.forTree(ctx, value, unusedAssignmentLabel,
                JavaFixUtilities.rewriteFix(ctx, Bundle.FIX_ChangeCompoundAssignmentToOperation(), ctx.getPath(), replace)
        );
    }
    return null;
}
 
Example 20
Source File: WatchesModel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Object getValueAt(Object node, String columnID) throws UnknownTypeException {
    if (node instanceof Watch) {
        Watch watch = (Watch) node;
        Pair<V8Value, String> ew;
        synchronized (evaluatedWatches) {
            ew = evaluatedWatches.get(watch);
        }
        if (ew != null) {
            if (ew.second() != null) {
                if (WATCH_VALUE_COLUMN_ID.equals(columnID) ||
                    WATCH_TO_STRING_COLUMN_ID.equals(columnID)) {
                    
                    return toHTML(ew.second(), true, false, Color.red);
                    
                } else if (WATCH_TYPE_COLUMN_ID.equals(columnID)) {
                    return "";
                }
            } else {
                V8Value value = ew.first();
                if (value != null) {
                    if (WATCH_VALUE_COLUMN_ID.equals(columnID) ||
                        WATCH_TO_STRING_COLUMN_ID.equals(columnID)) {
                        
                        return toHTML(V8Evaluator.getStringValue(value));
                        
                    } else if (WATCH_TYPE_COLUMN_ID.equals(columnID)) {
                        
                        return toHTML(V8Evaluator.getStringType(value));
                    }
                }
            }
        }
        if (WATCH_VALUE_COLUMN_ID.equals(columnID) ||
            WATCH_TO_STRING_COLUMN_ID.equals(columnID)) {
            return (watch.isEnabled()) ? "N/A" : "";
        } else if(WATCH_TYPE_COLUMN_ID.equals(columnID)) {
            return "";
        }
    } else {
        if (WATCH_VALUE_COLUMN_ID.equals(columnID)) {
            return super.getValueAt(node, LOCALS_VALUE_COLUMN_ID);
        } else if(WATCH_TYPE_COLUMN_ID.equals(columnID)) {
            return super.getValueAt(node, LOCALS_TYPE_COLUMN_ID);
        } else if (WATCH_TO_STRING_COLUMN_ID.equals(columnID) ||
                LOCALS_TO_STRING_COLUMN_ID.equals(columnID)) {
            return super.getValueAt(node, LOCALS_TO_STRING_COLUMN_ID);
        }
    }
    throw new UnknownTypeException(node);
}