Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE-3369 Git history panel is not opened #3480

Merged
merged 2 commits into from
Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,39 @@ public void setActivePart(@NotNull PartPresenter part) {

if (state == State.MINIMIZED) {
state = State.NORMAL;

if (currentSize < MIN_PART_SIZE) {
currentSize = DEFAULT_PART_SIZE;
}

workBenchPartController.setSize(currentSize);
workBenchPartController.setMinSize(MIN_PART_SIZE);
workBenchPartController.setHidden(false);

// Notify the part stack state has been changed.
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
eventBus.fireEvent(new PartStackStateChangedEvent(PartStackPresenter.this));
}
});
} else if (state == State.COLLAPSED) {
// Collapsed state means the other part stack is maximized.
// Ask the delegate to restore part stacks.
if (delegate != null) {
delegate.onRestore(this);
}

} else if (state == State.NORMAL) {
if (workBenchPartController.getSize() < MIN_PART_SIZE) {
workBenchPartController.setMinSize(MIN_PART_SIZE);
workBenchPartController.setSize(DEFAULT_PART_SIZE);
}

workBenchPartController.setHidden(false);
}

// Notify the part stack state has been changed.
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
eventBus.fireEvent(new PartStackStateChangedEvent(PartStackPresenter.this));
}
});

selectActiveTab(tab);
}

Expand Down Expand Up @@ -403,8 +418,17 @@ public void restore() {
// Restore and update the stack.
State prevState = state;
state = State.NORMAL;
workBenchPartController.setSize(currentSize);
workBenchPartController.setHidden(false);

if (!parts.isEmpty()) {

if (currentSize < MIN_PART_SIZE) {
currentSize = DEFAULT_PART_SIZE;
}

workBenchPartController.setSize(currentSize);
workBenchPartController.setMinSize(MIN_PART_SIZE);
workBenchPartController.setHidden(false);
}

// Ask the delegate to restore part stacks if this part stack was maximized.
if (prevState == State.MAXIMIZED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.eclipse.che.providers.DynaProvider;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -59,6 +58,12 @@ public abstract class AbstractPerspective implements Presenter, Perspective,
ActivePartChangedHandler, MaximizePartEvent.Handler,
PerspectiveView.ActionDelegate, PartStack.ActionDelegate {

/** The default size for the part. */
private static final double DEFAULT_PART_SIZE = 260;

/** The minimum allowable size for the part. */
private static final int MIN_PART_SIZE = 100;

protected final Map<PartStackType, PartStack> partStacks;
protected final PerspectiveViewImpl view;

Expand Down Expand Up @@ -397,8 +402,8 @@ private void restorePartController(PartStack partStack, WorkBenchPartController
double size = partStackJSON.getNumber("SIZE");

// Size of the part must not be less 100 pixels.
if (size < 100) {
size = 100;
if (size < MIN_PART_SIZE) {
size = DEFAULT_PART_SIZE;
}

controller.setSize(size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ public void showDialog(Project project) {
if (isViewClosed) {
workspaceAgent.openPart(this, PartStackType.TOOLING);
isViewClosed = false;
} else {
partStack.setActivePart(this);
}

partStack.setActivePart(this);
}

/** Get the log of the commits. If successfully received, then display in revision grid, otherwise - show error in output panel. */
Expand Down