Search in sources :

Example 6 with PartStack

use of org.eclipse.che.ide.api.parts.PartStack in project che by eclipse.

the class AbstractPerspectiveTest method nullShouldBeFound.

@Test
public void nullShouldBeFound() {
    when(partStackPresenter.containsPart(partPresenter)).thenReturn(true);
    PartStack partStack = perspective.findPartStackByPart(partPresenter);
    assertSame(partStack, partStackPresenter);
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack) Test(org.junit.Test)

Example 7 with PartStack

use of org.eclipse.che.ide.api.parts.PartStack in project che by eclipse.

the class AbstractPerspectiveTest method nullShouldBeReturnedWhenPartIsNotFound.

@Test
public void nullShouldBeReturnedWhenPartIsNotFound() {
    PartStack partStack = perspective.findPartStackByPart(partPresenter);
    assertSame(partStack, null);
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack) Test(org.junit.Test)

Example 8 with PartStack

use of org.eclipse.che.ide.api.parts.PartStack in project che by eclipse.

the class ExpandEditorAction method toggleExpand.

/**
     * Expands or restores the editor.
     */
public void toggleExpand() {
    Perspective perspective = perspectiveManager.getActivePerspective();
    if (perspective == null) {
        return;
    }
    PartStack partStack = perspective.getPartStack(PartStackType.EDITING);
    if (partStack == null) {
        return;
    }
    if (partStack.getPartStackState() == PartStack.State.NORMAL) {
        perspective.maximizeCentralPartStack();
        button.getElement().setInnerHTML(FontAwesome.COMPRESS);
    } else {
        perspective.restore();
        button.getElement().setInnerHTML(FontAwesome.EXPAND);
    }
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack) Perspective(org.eclipse.che.ide.api.parts.Perspective)

Aggregations

PartStack (org.eclipse.che.ide.api.parts.PartStack)8 Test (org.junit.Test)3 Perspective (org.eclipse.che.ide.api.parts.Perspective)1