Search in sources :

Example 1 with LocalHistoryFacade

use of com.intellij.history.core.LocalHistoryFacade in project intellij-community by JetBrains.

the class RevisionsTest method testAfterRevisionForRootEntry.

@Test
public void testAfterRevisionForRootEntry() {
    RootEntry root = new RootEntry();
    LocalHistoryFacade facade = new InMemoryLocalHistoryFacade();
    ChangeSet cs = addChangeSet(facade, createFile(root, "f1"));
    addChangeSet(facade, createFile(root, "f2"));
    Revision r = new ChangeRevision(facade, root, "", cs, false);
    RootEntry e = (RootEntry) r.findEntry();
    assertEquals(e.getClass(), RootEntry.class);
    assertNotNull(e.findEntry("f1"));
    assertNull(e.findEntry("f2"));
}
Also used : RootEntry(com.intellij.history.core.tree.RootEntry) InMemoryLocalHistoryFacade(com.intellij.history.core.InMemoryLocalHistoryFacade) LocalHistoryFacade(com.intellij.history.core.LocalHistoryFacade) InMemoryLocalHistoryFacade(com.intellij.history.core.InMemoryLocalHistoryFacade) ChangeSet(com.intellij.history.core.changes.ChangeSet) Test(org.junit.Test)

Example 2 with LocalHistoryFacade

use of com.intellij.history.core.LocalHistoryFacade in project intellij-community by JetBrains.

the class HistoryDialog method init.

protected void init() {
    LocalHistoryFacade facade = LocalHistoryImpl.getInstanceImpl().getFacade();
    myModel = createModel(facade);
    setTitle(myModel.getTitle());
    JComponent root = createComponent();
    setComponent(root);
    setPreferredFocusedComponent(showRevisionsList() ? myRevisionsList.getComponent() : myDiffView);
    myUpdateQueue = new MergingUpdateQueue(getClass() + ".revisionsUpdate", 500, true, root, this, null, false);
    myUpdateQueue.setRestartTimerOnAdd(true);
    facade.addListener(new LocalHistoryFacade.Listener() {

        public void changeSetFinished() {
            scheduleRevisionsUpdate(null);
        }
    }, this);
    scheduleRevisionsUpdate(null);
}
Also used : MergingUpdateQueue(com.intellij.util.ui.update.MergingUpdateQueue) LocalHistoryFacade(com.intellij.history.core.LocalHistoryFacade)

Example 3 with LocalHistoryFacade

use of com.intellij.history.core.LocalHistoryFacade in project intellij-community by JetBrains.

the class LocalHistoryAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    Presentation p = e.getPresentation();
    if (e.getProject() == null) {
        p.setEnabledAndVisible(false);
    } else {
        p.setVisible(true);
        p.setText(getText(e), true);
        LocalHistoryFacade vcs = getVcs();
        IdeaGateway gateway = getGateway();
        p.setEnabled(vcs != null && gateway != null && isEnabled(vcs, gateway, e));
    }
}
Also used : IdeaGateway(com.intellij.history.integration.IdeaGateway) LocalHistoryFacade(com.intellij.history.core.LocalHistoryFacade) Presentation(com.intellij.openapi.actionSystem.Presentation)

Aggregations

LocalHistoryFacade (com.intellij.history.core.LocalHistoryFacade)3 InMemoryLocalHistoryFacade (com.intellij.history.core.InMemoryLocalHistoryFacade)1 ChangeSet (com.intellij.history.core.changes.ChangeSet)1 RootEntry (com.intellij.history.core.tree.RootEntry)1 IdeaGateway (com.intellij.history.integration.IdeaGateway)1 Presentation (com.intellij.openapi.actionSystem.Presentation)1 MergingUpdateQueue (com.intellij.util.ui.update.MergingUpdateQueue)1 Test (org.junit.Test)1