public void annotate(Line.Set set, Lookup lookup) {
   final FileObject fo = lookup.lookup(FileObject.class);
   if (fo != null) {
     DataObject dobj = lookup.lookup(DataObject.class);
     if (dobj != null) {
       PropertyChangeListener pchl =
           new PropertyChangeListener() {
             /** annotate renamed files. */
             public void propertyChange(PropertyChangeEvent evt) {
               if (DataObject.PROP_PRIMARY_FILE.equals(evt.getPropertyName())) {
                 DataObject dobj = (DataObject) evt.getSource();
                 FileObject newFO = dobj.getPrimaryFile();
                 annotate(newFO);
               }
             }
           };
       dobj.addPropertyChangeListener(WeakListeners.propertyChange(pchl, dobj));
       synchronized (this) {
         if (dataObjectListeners == null) {
           dataObjectListeners = new HashSet<PropertyChangeListener>();
         }
         // Prevent from GC.
         dataObjectListeners.add(pchl);
       }
     }
     annotate(fo);
   }
 }
  DefaultPraxisProject(FileObject directory, FileObject projectFile, ProjectState state)
      throws IOException {
    this.directory = directory;
    this.projectFile = projectFile;
    this.state = state;
    properties = parseProjectFile(projectFile);
    propsListener = new PropertiesListener();
    properties.addPropertyChangeListener(propsListener);

    Lookup base =
        Lookups.fixed(
            new Object[] {
              this,
              properties,
              new Info(),
              new ActionImpl(),
              state,
              new PraxisCustomizerProvider(this),
              new PraxisLogicalViewProvider(this),
              new BaseTemplates(),
              UILookupMergerSupport.createPrivilegedTemplatesMerger()
            });

    this.lookup = LookupProviderSupport.createCompositeLookup(base, LOOKUP_PATH);
    helperListener = new HelperListener();
    ProjectHelper.getDefault()
        .addPropertyChangeListener(
            WeakListeners.propertyChange(helperListener, ProjectHelper.getDefault()));
  }
 private java.util.ArrayList getListOfTags() {
   java.util.ArrayList l = new java.util.ArrayList();
   List groups = dataset.getGroupsList();
   for (int i = 0; i < groups.size(); ++i) {
     JRDesignGroup group = (JRDesignGroup) groups.get(i);
     l.add(new Tag(group.getName(), group.getName()));
     group
         .getEventSupport()
         .addPropertyChangeListener(WeakListeners.propertyChange(this, group.getEventSupport()));
   }
   return l;
 }
Ejemplo n.º 4
0
 private JPDAWatchEvaluating(
     WatchesModel model, Watch w, JPDADebuggerImpl debugger, int cloneNumber) {
   super(debugger, null, (cloneNumber > 0) ? w + "_clone" + cloneNumber : "" + w);
   this.model = model;
   this.w = w;
   this.debugger = debugger;
   if (w.isEnabled()) {
     parseExpression(w.getExpression());
   }
   if (cloneNumber == 0) {
     debugger.varChangeSupport.addPropertyChangeListener(
         WeakListeners.propertyChange(this, debugger.varChangeSupport));
   }
 }
  @SuppressWarnings("unchecked")
  public EvaluationGroupProperty(HtmlComponent component, JRDesignDataset dataset) {
    // TODO: Replace WhenNoDataType with the right constant
    super(
        HtmlComponent.PROPERTY_EVALUATION_GROUP,
        JRGroup.class,
        "Evaluation group",
        "Evaluate the expression when the specified group changes",
        true,
        true);
    this.component = component;
    this.dataset = dataset;
    setValue("suppressCustomEditor", Boolean.TRUE);

    dataset
        .getEventSupport()
        .addPropertyChangeListener(WeakListeners.propertyChange(this, dataset.getEventSupport()));
  }
 public SaasGroupNodeChildren(SaasGroup group) {
   this.group = group;
   SaasServicesModel model = SaasServicesModel.getInstance();
   model.addPropertyChangeListener(WeakListeners.propertyChange(this, model));
 }
 private void init() {
   ServerList.addPropertyChangeListener(WeakListeners.propertyChange(this, this));
   presenter.setEnabled(!ServerList.getDefaultRecord().getExecutionEnvironment().isLocal());
 }