org.netbeans.modules.cnd.api.model/1 1.3 1

org.netbeans.modules.cnd.api.model
Interface CsmModel

All Known Subinterfaces:
CsmModelAccessor.CsmModelEx

public interface CsmModel

Source model


Method Summary
 void addModelListener(CsmModelListener listener)
           
 void addModelStateListener(CsmModelStateListener listener)
           
 void addProgressListener(CsmProgressListener listener)
           
 void enqueue(Runnable task)
          Code model calls can be very expensive.
 void enqueue(Runnable task, String name)
          Code model calls can be very expensive.
 CsmFile findFile(String absPath)
          Find project that contains file.
 CsmProject getProject(Object id)
           
 CsmModelState getState()
          Returns the state of the model
 Collection<CsmProject> projects()
           
 void removeModelListener(CsmModelListener listener)
           
 void removeModelStateListener(CsmModelStateListener listener)
           
 void removeProgressListener(CsmProgressListener listener)
           
 

Method Detail

getProject

CsmProject getProject(Object id)
Parameters:
id - Netbeans project

projects

Collection<CsmProject> projects()

addModelListener

void addModelListener(CsmModelListener listener)

removeModelListener

void removeModelListener(CsmModelListener listener)

addProgressListener

void addProgressListener(CsmProgressListener listener)

removeProgressListener

void removeProgressListener(CsmProgressListener listener)

addModelStateListener

void addModelStateListener(CsmModelStateListener listener)

removeModelStateListener

void removeModelStateListener(CsmModelStateListener listener)

enqueue

void enqueue(Runnable task)
Code model calls can be very expensive. Therefore one can never call code model from event dispatching thread. Moreover, to make code model able to effectively solve synchronization issues, all callers shall use not their own threads but call enqueue method instead. The method creates a thread and runs the given task in this thread. Whether or not the thread be created immediately or the task will be just enqueued and runned later on, depends on implementation.

Parameters:
task - task to run

enqueue

void enqueue(Runnable task,
             String name)
Code model calls can be very expensive. Therefore one can never call code model from event dispatching thread. Moreover, to make code model able to effectively solve synchronization issues, all callers shall use not their own threads but call enqueue method instead. The method creates a thread and runs the given task in this thread. Whether or not the thread be created immediately or the task will be just enqueued and runned later on, depends on implementation. We recommend using this method rather than one without name parameter.

Parameters:
task - task to run
name - name that would be added to the thread name

findFile

CsmFile findFile(String absPath)
Find project that contains file. Returns CsmFile if project is found. This function might be costly (this depends on the model state). CAUTION: this method should never be called directly from the thread, in which model notificatios (either CsmModelListener or CsmProgressListener) come. These notifications come directly in parser thread or project initialization thread. Calling findFile from these threads may cause deadlock. TODO: add CsmFile[] findFiles(String absPath) since there might be multiple CsmFile instances, associated with the same path, in the case the same file is included into different projects

Parameters:
absPath - absolute file path

getState

CsmModelState getState()
Returns the state of the model


org.netbeans.modules.cnd.api.model/1 1.3 1

Built on November 23 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.

Project Features

About this Project

CND was started in November 2009, is owned by DimaZh, and has 194 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close