Search in sources :

Example 1 with PartStack

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

the class AbstractPerspectiveTest method partStackShouldBeReturned.

@Test
public void partStackShouldBeReturned() {
    perspective.addPart(partPresenter, INFORMATION);
    PartStack partStack = perspective.getPartStack(INFORMATION);
    assertSame(partStack, partStackPresenter);
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack) Test(org.junit.Test)

Example 2 with PartStack

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

the class AbstractPerspective method addPart.

/** {@inheritDoc} */
@Override
public void addPart(@NotNull PartPresenter part, @NotNull PartStackType type, @Nullable Constraints constraint) {
    PartStack destPartStack = partStacks.get(type);
    List<String> rules = part.getRules();
    if (rules.isEmpty() || rules.contains(perspectiveId)) {
        destPartStack.addPart(part, constraint);
        return;
    }
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack)

Example 3 with PartStack

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

the class AbstractPerspective method onMaximize.

@Override
public void onMaximize(PartStack partStack) {
    if (partStack == null) {
        return;
    }
    if (partStack.equals(maximizedPartStack)) {
        return;
    }
    maximizedPartStack = partStack;
    for (PartStack ps : partStacks.values()) {
        if (!ps.equals(partStack)) {
            ps.collapse();
        }
    }
    partStack.maximize();
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack)

Example 4 with PartStack

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

the class AbstractPerspective method setActivePart.

/** {@inheritDoc} */
@Override
public void setActivePart(@NotNull PartPresenter part, @NotNull PartStackType type) {
    PartStack destPartStack = partStacks.get(type);
    destPartStack.setActivePart(part);
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack)

Example 5 with PartStack

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

the class AbstractPerspective method openActivePart.

/**
     * Opens previous active tab on current perspective.
     *
     * @param partStackType
     *         part type on which need open previous active part
     */
protected void openActivePart(@NotNull PartStackType partStackType) {
    PartStack partStack = partStacks.get(partStackType);
    partStack.openPreviousActivePart();
}
Also used : PartStack(org.eclipse.che.ide.api.parts.PartStack)

Aggregations

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