示例#1
0
  @Override
  public void disposeUIResources() {
    if (!myUiInitialized) return;
    final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject);
    propertiesComponent.setValue("project.structure.last.edited", myUiState.lastEditedConfigurable);
    propertiesComponent.setValue(
        "project.structure.proportion", String.valueOf(myUiState.proportion));
    propertiesComponent.setValue(
        "project.structure.side.proportion", String.valueOf(myUiState.sideProportion));

    myWasUiDisposed = true;

    myUiState.proportion = mySplitter.getProportion();
    saveSideProportion();
    myContext.getDaemonAnalyzer().stop();
    for (Configurable each : myName2Config) {
      each.disposeUIResources();
    }
    myContext.clear();
    myName2Config.clear();

    myModuleConfigurator.getFacetsConfigurator().clearMaps();

    Disposer.dispose(myErrorsComponent);

    myUiInitialized = false;
  }
  public void disposeUIResources() {
    if (myUiDisposed) return;

    super.disposeUIResources();

    myUiDisposed = true;

    myAutoScrollHandler.cancelAllRequests();

    myContext.getDaemonAnalyzer().clear();

    Disposer.dispose(this);
  }
  public void init(StructureConfigurableContext context) {
    myContext = context;
    myContext
        .getDaemonAnalyzer()
        .addListener(
            new ProjectStructureDaemonAnalyzerListener() {
              public void problemsChanged(@NotNull ProjectStructureElement element) {
                if (!myTree.isShowing()) return;

                myTree.revalidate();
                myTree.repaint();
              }
            });
  }
示例#4
0
 @Override
 public void setDisplayName(String name) {
   name = name.trim();
   final ModifiableModuleModel modifiableModuleModel = myConfigurator.getModuleModel();
   if (StringUtil.isEmpty(name)) return; // empty string comes on double click on module node
   if (Comparing.strEqual(name, myModuleName)) return; // nothing changed
   try {
     modifiableModuleModel.renameModule(myModule, name);
   } catch (ModuleWithNameAlreadyExistsException ignored) {
   }
   myConfigurator.moduleRenamed(myModule, myModuleName, name);
   myModuleName = name;
   myConfigurator.setModified(!Comparing.strEqual(myModuleName, myModule.getName()));
   myContext.getDaemonAnalyzer().queueUpdateForAllElementsWithErrors();
 }
  public void reset() {
    myUiDisposed = false;

    if (!myWasTreeInitialized) {
      initTree();
      myTree.setShowsRootHandles(false);
      loadTree();
    } else {
      super.disposeUIResources();
      myTree.setShowsRootHandles(false);
      loadTree();
    }
    for (ProjectStructureElement element : getProjectStructureElements()) {
      myContext.getDaemonAnalyzer().queueUpdate(element);
    }

    super.reset();
  }
示例#6
0
  @Override
  public void apply() throws ConfigurationException {
    for (Configurable each : myName2Config) {
      if (each instanceof BaseStructureConfigurable && each.isModified()) {
        ((BaseStructureConfigurable) each).checkCanApply();
      }
    }
    for (Configurable each : myName2Config) {
      if (each.isModified()) {
        each.apply();
      }
    }

    myContext.getDaemonAnalyzer().clearCaches();
    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            BuildManager.getInstance().scheduleAutoMake();
          }
        });
  }