Пример #1
0
  public AttributeControllerImpl() {
    projectController = Lookup.getDefault().lookup(ProjectController.class);
    projectController.addWorkspaceListener(
        new WorkspaceListener() {

          public void initialize(Workspace workspace) {
            AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
            if (m == null) {
              workspace.add(new IndexedAttributeModel());
            }
          }

          public void select(Workspace workspace) {}

          public void unselect(Workspace workspace) {}

          public void close(Workspace workspace) {}

          public void disable() {}
        });
    if (projectController.getCurrentProject() != null) {
      for (Workspace workspace :
          projectController
              .getCurrentProject()
              .getLookup()
              .lookup(WorkspaceProvider.class)
              .getWorkspaces()) {
        AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
        if (m == null) {
          workspace.add(new IndexedAttributeModel());
        }
      }
    }
  }
Пример #2
0
 public synchronized AttributeModel getModel(Workspace workspace) {
   AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
   if (model != null) {
     return model;
   }
   model = new IndexedAttributeModel();
   workspace.add(model);
   return model;
 }
 @Override
 public StatisticsModel getModel(Workspace workspace) {
   StatisticsModel statModel = workspace.getLookup().lookup(StatisticsModelImpl.class);
   if (statModel == null) {
     statModel = new StatisticsModelImpl();
     workspace.add(statModel);
   }
   return statModel;
 }
Пример #4
0
 public synchronized AttributeModel getModel() {
   Workspace workspace = projectController.getCurrentWorkspace();
   if (workspace != null) {
     AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
     if (model != null) {
       return model;
     }
     model = new IndexedAttributeModel();
     workspace.add(model);
     return model;
   }
   return null;
 }
 public void readXML(Element element, Workspace workspace) {
   FilterModelImpl filterModel = new FilterModelImpl();
   filterModel.readXML(element);
   workspace.add(filterModel);
 }