2 * Copyright 2000-2006 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 package com
.intellij
.util
.xml
.ui
;
20 import com
.intellij
.ui
.UserActivityListener
;
21 import com
.intellij
.openapi
.application
.ApplicationManager
;
22 import com
.intellij
.util
.ui
.update
.MergingUpdateQueue
;
23 import com
.intellij
.util
.ui
.update
.Update
;
24 import com
.intellij
.util
.Alarm
;
27 * User: Sergey.Vasiliev
29 public class CommitablePanelUserActivityListener
implements UserActivityListener
{
30 private boolean myResetting
;
32 CommittablePanel myPanel
;
34 private Alarm myAlarm
;
36 public CommitablePanelUserActivityListener() {
39 public CommitablePanelUserActivityListener(final CommittablePanel panel
) {
41 myAlarm
= new Alarm();
44 final public void stateChanged() {
45 myAlarm
.cancelAllRequests();
46 myAlarm
.addRequest(new Runnable() {
54 protected void doActivity() {
56 ApplicationManager
.getApplication().invokeLater(new Runnable() {
72 protected void applyChanges() {
73 if (myPanel
!= null) {
78 protected void doAfterApply() {