Java 类com.intellij.ui.UserActivityListener 实例源码

项目:intellij-ce-playground    文件:CodeStyleAbstractPanel.java   
protected CodeStyleAbstractPanel(@Nullable Language defaultLanguage,
                                 @Nullable CodeStyleSettings currentSettings,
                                 @NotNull CodeStyleSettings settings)
{
  Disposer.register(this, myDiffCalculator);
  myCurrentSettings = currentSettings;
  mySettings = settings;
  myDefaultLanguage = defaultLanguage;
  myEditor = createEditor();

  if (myEditor != null) {
    myUpdateAlarm.setActivationComponent(myEditor.getComponent());
  }
  myUserActivityWatcher.addUserActivityListener(new UserActivityListener() {
    @Override
    public void stateChanged() {
      somethingChanged();
    }
  });

  updatePreview(true);
}
项目:intellij-ce-playground    文件:DomUIFactoryImpl.java   
@Override
public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) {
  final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher();
  userActivityWatcher.addUserActivityListener(new UserActivityListener() {
    private boolean isProcessingChange;

    @Override
    public void stateChanged() {
      if (isProcessingChange) return;
      isProcessingChange = true;
      try {
        for (final DomElement element : elements) {
          DomElementAnnotationsManagerImpl.outdateProblemHolder(element);
        }
        CommittableUtil.updateHighlighting(panel);
      }
      finally {
        isProcessingChange = false;
      }
    }
  }, panel);
  userActivityWatcher.register(panel.getComponent());
}
项目:tools-idea    文件:CodeStyleAbstractPanel.java   
protected CodeStyleAbstractPanel(@Nullable Language defaultLanguage,
                                 @Nullable CodeStyleSettings currentSettings,
                                 @NotNull CodeStyleSettings settings)
{
  Disposer.register(this, myDiffCalculator);
  myCurrentSettings = currentSettings;
  mySettings = settings;
  myDefaultLanguage = defaultLanguage;
  myEditor = createEditor();

  if (myEditor != null) {
    myUpdateAlarm.setActivationComponent(myEditor.getComponent());
  }
  myUserActivityWatcher.addUserActivityListener(new UserActivityListener() {
    @Override
    public void stateChanged() {
      somethingChanged();
    }
  });

  updatePreview(true);
}
项目:tools-idea    文件:DomUIFactoryImpl.java   
public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) {
  final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher();
  userActivityWatcher.addUserActivityListener(new UserActivityListener() {
    private boolean isProcessingChange;

    public void stateChanged() {
      if (isProcessingChange) return;
      isProcessingChange = true;
      try {
        for (final DomElement element : elements) {
          DomElementAnnotationsManagerImpl.outdateProblemHolder(element);
        }
        CommittableUtil.updateHighlighting(panel);
      }
      finally {
        isProcessingChange = false;
      }
    }
  }, panel);
  userActivityWatcher.register(panel.getComponent());
}
项目:consulo    文件:CodeStyleAbstractPanel.java   
protected CodeStyleAbstractPanel(@Nullable Language defaultLanguage,
                                 @Nullable CodeStyleSettings currentSettings,
                                 @Nonnull CodeStyleSettings settings)
{
  Disposer.register(this, myDiffCalculator);
  myCurrentSettings = currentSettings;
  mySettings = settings;
  myDefaultLanguage = defaultLanguage;
  myEditor = createEditor();

  if (myEditor != null) {
    myUpdateAlarm.setActivationComponent(myEditor.getComponent());
  }
  myUserActivityWatcher.addUserActivityListener(new UserActivityListener() {
    @Override
    public void stateChanged() {
      somethingChanged();
    }
  });

  updatePreview(true);
}
项目:consulo-xml    文件:DomUIFactoryImpl.java   
public void setupErrorOutdatingUserActivityWatcher(final CommittablePanel panel, final DomElement... elements) {
  final UserActivityWatcher userActivityWatcher = createEditorAwareUserActivityWatcher();
  userActivityWatcher.addUserActivityListener(new UserActivityListener() {
    private boolean isProcessingChange;

    public void stateChanged() {
      if (isProcessingChange) return;
      isProcessingChange = true;
      try {
        for (final DomElement element : elements) {
          DomElementAnnotationsManagerImpl.outdateProblemHolder(element);
        }
        CommittableUtil.updateHighlighting(panel);
      }
      finally {
        isProcessingChange = false;
      }
    }
  }, panel);
  userActivityWatcher.register(panel.getComponent());
}
项目:intellij-ce-playground    文件:SettingsEditor.java   
protected void installWatcher(JComponent c) {
  myWatcher = new UserActivityWatcher();
  myWatcher.register(c);
  UserActivityListener userActivityListener = new UserActivityListener() {
    @Override
    public void stateChanged() {
      fireEditorStateChanged();
    }
  };
  myWatcher.addUserActivityListener(userActivityListener, this);
}
项目:intellij-ce-playground    文件:FacetErrorPanel.java   
@Override
public void registerValidator(final FacetEditorValidator validator, JComponent... componentsToWatch) {
  myValidators.add(validator);
  final UserActivityWatcher watcher = new UserActivityWatcher();
  for (JComponent component : componentsToWatch) {
    watcher.register(component);
  }
  watcher.addUserActivityListener(new UserActivityListener() {
    @Override
    public void stateChanged() {
      validate();
    }
  });
}
项目:tools-idea    文件:SettingsEditor.java   
protected void installWatcher(JComponent c) {
  myWatcher = new UserActivityWatcher();
  myWatcher.register(c);
  UserActivityListener userActivityListener = new UserActivityListener() {
    @Override
    public void stateChanged() {
      fireEditorStateChanged();
    }
  };
  myWatcher.addUserActivityListener(userActivityListener, this);
}
项目:tools-idea    文件:FacetErrorPanel.java   
@Override
public void registerValidator(final FacetEditorValidator validator, JComponent... componentsToWatch) {
  myValidators.add(validator);
  final UserActivityWatcher watcher = new UserActivityWatcher();
  for (JComponent component : componentsToWatch) {
    watcher.register(component);
  }
  watcher.addUserActivityListener(new UserActivityListener() {
    @Override
    public void stateChanged() {
      validate();
    }
  });
}