Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.languages;
import java.awt.Point;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import javax.swing.text.Document;
import org.netbeans.api.lexer.TokenHierarchy;
import org.netbeans.api.lexer.TokenSequence;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor.Message;
import org.openide.filesystems.FileObject;
import org.openide.util.Exceptions;
import org.openide.util.Lookup;
import org.openide.util.RequestProcessor;
/**
*
* @author Jan Jancura
*/
public class Utils {
private static Logger logger = Logger.getLogger ("org.netbeans.modules.languages");
public static void notify (String message) {
logger.log (Level.WARNING, message);
}
public static void message (final String message) {
SwingUtilities.invokeLater (new Runnable () {
public void run () {
DialogDisplayer.getDefault ().notify (new Message (message));
}
});
}
public static void notify (Exception exception) {
logger.log (Level.WARNING, null, exception);
}
public static void notify (String message, Exception exception) {
logger.log (Level.WARNING, message, exception);
}
private static Map collections;
public static void startTest (String name, Collection c) {
if (collections == null) {
// init
collections = new HashMap ();
start ();
}
collections.put (name, new WeakReference (c));
}
public static void startTest (String name, Map m) {
if (collections == null) {
// init
collections = new HashMap ();
start ();
}
collections.put (name, new WeakReference