org.netbeans.modules.java.project/1 1.8.22

org.netbeans.spi.java.project.support.ui
Class BrokenReferencesSupport

java.lang.Object
  extended by org.netbeans.spi.java.project.support.ui.BrokenReferencesSupport

public class BrokenReferencesSupport
extends Object

Support for managing broken project references. Project freshly checkout from VCS can has broken references of several types: reference to other project, reference to a foreign file, reference to an external source root, reference to a Java Library or reference to a Java Platform. This class has helper methods for detection of these problems and for fixing them.

Typical usage of this class it to check whether the project has some broken references and if it has then providing an action on project's node which allows to correct these configuration problems by showing broken references customizer.


Method Summary
static boolean isBroken(AntProjectHelper projectHelper, ReferenceHelper referenceHelper, String[] properties, String[] platformProperties)
          Checks whether the project has some broken references or not.
static void showAlert()
          Show alert message box informing user that a project has broken references.
static void showCustomizer(AntProjectHelper projectHelper, ReferenceHelper referenceHelper, String[] properties, String[] platformProperties)
          Shows UI customizer which gives users chance to fix encountered problems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isBroken

public static boolean isBroken(AntProjectHelper projectHelper,
                               ReferenceHelper referenceHelper,
                               String[] properties,
                               String[] platformProperties)
Checks whether the project has some broken references or not.

Parameters:
projectHelper - AntProjectHelper associated with the project.
referenceHelper - ReferenceHelper associated with the project.
properties - array of property names which values hold references which may be broken. For example for J2SE project the property names will be: "javac.classpath", "run.classpath", etc.
platformProperties - array of property names which values hold name of the platform(s) used by the project. These platforms will be checked for existence. For example for J2SE project the property name is one and it is "platform.active". The name of the default platform is expected to be "default_platform" and this platform always exists.
Returns:
true if some problem was found and it is necessary to give user a chance to fix them

showCustomizer

public static void showCustomizer(AntProjectHelper projectHelper,
                                  ReferenceHelper referenceHelper,
                                  String[] properties,
                                  String[] platformProperties)
Shows UI customizer which gives users chance to fix encountered problems.

Parameters:
projectHelper - AntProjectHelper associated with the project.
referenceHelper - ReferenceHelper associated with the project.
properties - array of property names which values hold references which may be broken. For example for J2SE project the property names will be: "javac.classpath", "run.classpath", etc.
platformProperties - array of property names which values hold name of the platform(s) used by the project. These platforms will be checked for existence. For example for J2SE project the property name is one and it is "platform.active". The name of the default platform is expected to be "default_platform" and this platform always exists.

showAlert

public static void showAlert()
Show alert message box informing user that a project has broken references. This method can be safely called from any thread, e.g. during the project opening, and it will take care about showing message box only once for several subsequent calls during a timeout. The alert box has also "show this warning again" check box.


org.netbeans.modules.java.project/1 1.8.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.