Java 类com.intellij.util.config.Storage 实例源码

项目:intellij-ce-playground    文件:BaseTableView.java   
public static void store(final Storage storage, final JTable table) {
  final TableColumnModel model = table.getTableHeader().getColumnModel();
  final int columnCount = model.getColumnCount();
  final boolean[] storedColumns = new boolean[columnCount];
  Arrays.fill(storedColumns, false);
  for (int i = 0; i < columnCount; i++) {
    final TableColumn column = model.getColumn(i);
    storage.put(widthPropertyName(i), String.valueOf(column.getWidth()));
    final int modelIndex = column.getModelIndex();
    storage.put(orderPropertyName(i), String.valueOf(modelIndex));
    if (storedColumns[modelIndex]) {
      LOG.error("columnCount: " + columnCount + " current: " + i + " modelINdex: " + modelIndex);
    }
    storedColumns[modelIndex] = true;
  }
}
项目:tools-idea    文件:BaseTableView.java   
public static void store(final Storage storage, final JTable table) {
  final TableColumnModel model = table.getTableHeader().getColumnModel();
  final int columnCount = model.getColumnCount();
  final boolean[] storedColumns = new boolean[columnCount];
  Arrays.fill(storedColumns, false);
  for (int i = 0; i < columnCount; i++) {
    final TableColumn column = model.getColumn(i);
    storage.put(widthPropertyName(i), String.valueOf(column.getWidth()));
    final int modelIndex = column.getModelIndex();
    storage.put(orderPropertyName(i), String.valueOf(modelIndex));
    if (storedColumns[modelIndex]) {
      LOG.error("columnCount: " + columnCount + " current: " + i + " modelINdex: " + modelIndex);
    }
    storedColumns[modelIndex] = true;
  }
}
项目:consulo    文件:BaseTableView.java   
public static void store(final Storage storage, final JTable table) {
  final TableColumnModel model = table.getTableHeader().getColumnModel();
  final int columnCount = model.getColumnCount();
  final boolean[] storedColumns = new boolean[columnCount];
  Arrays.fill(storedColumns, false);
  for (int i = 0; i < columnCount; i++) {
    final TableColumn column = model.getColumn(i);
    storage.put(widthPropertyName(i), String.valueOf(column.getWidth()));
    final int modelIndex = column.getModelIndex();
    storage.put(orderPropertyName(i), String.valueOf(modelIndex));
    if (storedColumns[modelIndex]) {
      LOG.error("columnCount: " + columnCount + " current: " + i + " modelINdex: " + modelIndex);
    }
    storedColumns[modelIndex] = true;
  }
}
项目:intellij-ce-playground    文件:BaseTableView.java   
public static void restore(final Storage storage, final JTable table) {
  final TableColumnModel columnModel = table.getTableHeader().getColumnModel();
  int index = 0;
  final ArrayList<String> columnIndices = new ArrayList<String>();
  while (true) {
    final String order = storage.get(orderPropertyName(index));
    if (order == null) break;
    columnIndices.add(order);
    index++;
    if (index == table.getColumnCount()) break;
  }
  index = 0;
  for (final String columnIndex : columnIndices) {
    final int modelColumnIndex = indexbyModelIndex(columnModel, Integer.parseInt(columnIndex));
    if (modelColumnIndex > 0 && modelColumnIndex < columnModel.getColumnCount()) {
      columnModel.moveColumn(modelColumnIndex, index);
    }
    index++;
  }
  for (int i = 0; i < columnIndices.size(); i++) {
    final String width = storage.get(widthPropertyName(i));
    if (width != null && width.length() > 0) {
      try {
        columnModel.getColumn(i).setPreferredWidth(Integer.parseInt(width));
      } catch(NumberFormatException e) {
        LOG.error("Bad width: " + width + " at column: "+ i + " from: " + storage +
                  " actual columns count: " + columnModel.getColumnCount() +
                  " info count: " + columnIndices.size(), e);
      }
    }
  }
}
项目:intellij-ce-playground    文件:BaseTableView.java   
public static void restoreWidth(final Storage storage, final TableColumnModel columns) {
  for (int index = 0; true; index++) {
    final String widthValue = storage.get(widthPropertyName(index));
    if (widthValue == null) break;
    try {
      columns.getColumn(index).setPreferredWidth(Integer.parseInt(widthValue));
    } catch(NumberFormatException e) {
      LOG.error("Bad width: " + widthValue + " at column: " + index + " from: " + storage, e);
    }
  }
}
项目:tools-idea    文件:BaseTableView.java   
public static void restore(final Storage storage, final JTable table) {
  final TableColumnModel columnModel = table.getTableHeader().getColumnModel();
  int index = 0;
  final ArrayList<String> columnIndices = new ArrayList<String>();
  while (true) {
    final String order = storage.get(orderPropertyName(index));
    if (order == null) break;
    columnIndices.add(order);
    index++;
    if (index == table.getColumnCount()) break;
  }
  index = 0;
  for (final String columnIndex : columnIndices) {
    final int modelColumnIndex = indexbyModelIndex(columnModel, Integer.parseInt(columnIndex));
    if (modelColumnIndex > 0 && modelColumnIndex < columnModel.getColumnCount()) {
      columnModel.moveColumn(modelColumnIndex, index);
    }
    index++;
  }
  for (int i = 0; i < columnIndices.size(); i++) {
    final String width = storage.get(widthPropertyName(i));
    if (width != null && width.length() > 0) {
      try {
        columnModel.getColumn(i).setPreferredWidth(Integer.parseInt(width));
      } catch(NumberFormatException e) {
        LOG.error("Bad width: " + width + " at column: "+ i + " from: " + storage +
                  " actual columns count: " + columnModel.getColumnCount() +
                  " info count: " + columnIndices.size(), e);
      }
    }
  }
}
项目:tools-idea    文件:BaseTableView.java   
public static void restoreWidth(final Storage storage, final TableColumnModel columns) {
  for (int index = 0; true; index++) {
    final String widthValue = storage.get(widthPropertyName(index));
    if (widthValue == null) break;
    try {
      columns.getColumn(index).setPreferredWidth(Integer.parseInt(widthValue));
    } catch(NumberFormatException e) {
      LOG.error("Bad width: " + widthValue + " at column: " + index + " from: " + storage, e);
    }
  }
}
项目:tools-idea    文件:SMTRunnerConsoleProperties.java   
/**
 * @param config
 * @param testFrameworkName Prefix for storage which keeps runner settings. E.g. "RubyTestUnit"
 * @param executor
 */
public SMTRunnerConsoleProperties(@NotNull final RunConfiguration config,
                                  @NotNull final String testFrameworkName,
                                  @NotNull final Executor executor)
{
  super(new Storage.PropertiesComponentStorage(testFrameworkName + "Support.", PropertiesComponent.getInstance()),
        config.getProject(),
        executor);
  myConfiguration = config;
  myCustomFilter = new CompositeFilter(config.getProject());
}
项目:consulo    文件:BaseTableView.java   
public static void restore(final Storage storage, final JTable table) {
  final TableColumnModel columnModel = table.getTableHeader().getColumnModel();
  int index = 0;
  final ArrayList<String> columnIndices = new ArrayList<String>();
  while (true) {
    final String order = storage.get(orderPropertyName(index));
    if (order == null) break;
    columnIndices.add(order);
    index++;
    if (index == table.getColumnCount()) break;
  }
  index = 0;
  for (final String columnIndex : columnIndices) {
    final int modelColumnIndex = indexbyModelIndex(columnModel, Integer.parseInt(columnIndex));
    if (modelColumnIndex > 0 && modelColumnIndex < columnModel.getColumnCount()) {
      columnModel.moveColumn(modelColumnIndex, index);
    }
    index++;
  }
  for (int i = 0; i < columnIndices.size(); i++) {
    final String width = storage.get(widthPropertyName(i));
    if (width != null && width.length() > 0) {
      try {
        columnModel.getColumn(i).setPreferredWidth(Integer.parseInt(width));
      } catch(NumberFormatException e) {
        LOG.error("Bad width: " + width + " at column: "+ i + " from: " + storage +
                  " actual columns count: " + columnModel.getColumnCount() +
                  " info count: " + columnIndices.size(), e);
      }
    }
  }
}
项目:consulo    文件:BaseTableView.java   
public static void restoreWidth(final Storage storage, final TableColumnModel columns) {
  for (int index = 0; true; index++) {
    final String widthValue = storage.get(widthPropertyName(index));
    if (widthValue == null) break;
    try {
      columns.getColumn(index).setPreferredWidth(Integer.parseInt(widthValue));
    } catch(NumberFormatException e) {
      LOG.error("Bad width: " + widthValue + " at column: " + index + " from: " + storage, e);
    }
  }
}
项目:intellij-ce-playground    文件:BaseTableView.java   
public static void storeWidth(final Storage storage, final TableColumnModel columns) {
  for (int i = 0; i < columns.getColumnCount(); i++) {
    storage.put(widthPropertyName(i), String.valueOf(columns.getColumn(i).getWidth()));
  }
}
项目:intellij-ce-playground    文件:SMTRunnerConsoleProperties.java   
@NotNull
private static Storage.PropertiesComponentStorage getStorage(String testFrameworkName) {
  return new Storage.PropertiesComponentStorage(testFrameworkName + "Support.", PropertiesComponent.getInstance());
}
项目:intellij-ce-playground    文件:TestConsoleProperties.java   
public TestConsoleProperties(@NotNull Storage storage, Project project, Executor executor) {
  super(storage);
  myProject = project;
  myExecutor = executor;
}
项目:intellij-ce-playground    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(String groupName, PropertiesComponent propertiesComponent) {
  this(new Storage.PropertiesComponentStorage(groupName, propertiesComponent));
}
项目:intellij-ce-playground    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(@NotNull Storage storage) {
  myStorage = storage;
}
项目:tools-idea    文件:JavaAwareTestConsoleProperties.java   
public JavaAwareTestConsoleProperties(final Storage storage, Project project, Executor executor) {
  super(storage, project, executor);
}
项目:tools-idea    文件:BaseTableView.java   
public static void storeWidth(final Storage storage, final TableColumnModel columns) {
  for (int i = 0; i < columns.getColumnCount(); i++) {
    storage.put(widthPropertyName(i), String.valueOf(columns.getColumn(i).getWidth()));
  }
}
项目:tools-idea    文件:TestConsoleProperties.java   
public TestConsoleProperties(final Storage storage, Project project, Executor executor) {
  super(storage);
  myProject = project;
  myExecutor = executor;
}
项目:tools-idea    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(@NonNls final String groupName, final PropertiesComponent propertiesComponent) {
  this(new Storage.PropertiesComponentStorage(groupName, propertiesComponent));
}
项目:tools-idea    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(final Storage storage) {
  myStorage = storage;
}
项目:tools-idea    文件:TestNGConsoleProperties.java   
public TestNGConsoleProperties(TestNGConfiguration config, Executor executor)
{
  super(new Storage.PropertiesComponentStorage(PREFIX, PropertiesComponent.getInstance()), config.getProject(), executor);
  myConfiguration = config;
}
项目:tools-idea    文件:JUnitConsoleProperties.java   
public JUnitConsoleProperties(@NotNull JUnitConfiguration configuration, Executor executor) {
  this(configuration, new Storage.PropertiesComponentStorage(GROUP_NAME, PropertiesComponent.getInstance()), executor);
}
项目:tools-idea    文件:JUnitConsoleProperties.java   
public JUnitConsoleProperties(@NotNull JUnitConfiguration configuration, final Storage storage, Executor executor) {
  super(storage, configuration.getProject(), executor);
  myConfiguration = configuration;
}
项目:maven-test-support-plugin    文件:MavenTestConsoleProperties.java   
public MavenTestConsoleProperties(MavenProject mavenProject, Project project, Executor executor, RunProfile configuration, ProcessHandler processHandler) {
    super(new Storage.PropertiesComponentStorage("MavenTestSupport.", PropertiesComponent.getInstance()), project, executor);
    this.mavenProject = mavenProject;
    this.configuration = configuration;
    this.processHandler = processHandler;
}
项目:consulo    文件:SMTRunnerConsoleProperties.java   
@Nonnull
private static Storage.PropertiesComponentStorage getStorage(String testFrameworkName) {
  return new Storage.PropertiesComponentStorage(testFrameworkName + "Support.", PropertiesComponent.getInstance());
}
项目:consulo    文件:BaseTableView.java   
public static void storeWidth(final Storage storage, final TableColumnModel columns) {
  for (int i = 0; i < columns.getColumnCount(); i++) {
    storage.put(widthPropertyName(i), String.valueOf(columns.getColumn(i).getWidth()));
  }
}
项目:consulo    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(@NonNls final String groupName, final PropertiesComponent propertiesComponent) {
  this(new Storage.PropertiesComponentStorage(groupName, propertiesComponent));
}
项目:consulo    文件:StoringPropertyContainer.java   
public StoringPropertyContainer(final Storage storage) {
  myStorage = storage;
}