-
Notifications
You must be signed in to change notification settings - Fork 219
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
JBPM-8903 : Stunner - Properties panel is not opened after clicking on "Minimize panel" button #3127
Merged
Merged
JBPM-8903 : Stunner - Properties panel is not opened after clicking on "Minimize panel" button #3127
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...g/kie/workbench/common/stunner/core/client/event/screen/ScreenPreMaximizedStateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,41 @@ | ||||||
/* | ||||||
* Copyright 2020 Red Hat, Inc. and/or its affiliates. | ||||||
* | ||||||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
* you may not use this file except in compliance with the License. | ||||||
* You may obtain a copy of the License at | ||||||
* | ||||||
* http://www.apache.org/licenses/LICENSE-2.0 | ||||||
* | ||||||
* Unless required by applicable law or agreed to in writing, software | ||||||
* distributed under the License is distributed on an "AS IS" BASIS, | ||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
* See the License for the specific language governing permissions and | ||||||
* limitations under the License. | ||||||
*/ | ||||||
|
||||||
package org.kie.workbench.common.stunner.core.client.event.screen; | ||||||
|
||||||
public class ScreenPreMaximizedStateEvent extends ScreenResizeEvent { | ||||||
|
||||||
private final boolean isExplorerScreen; | ||||||
|
||||||
public ScreenPreMaximizedStateEvent(final boolean isExplorerScreen ) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
super(true); | ||||||
this.isExplorerScreen = isExplorerScreen; | ||||||
} | ||||||
|
||||||
public boolean isExplorerScreen() { | ||||||
return isExplorerScreen; | ||||||
} | ||||||
|
||||||
@Override | ||||||
public int hashCode() { | ||||||
return super.hashCode(); | ||||||
} | ||||||
|
||||||
@Override | ||||||
public boolean equals(Object obj) { | ||||||
return super.equals(obj); | ||||||
} | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -21,6 +21,7 @@ | |||
|
||||
import javax.enterprise.context.Dependent; | ||||
import javax.enterprise.event.Event; | ||||
import javax.enterprise.event.Observes; | ||||
import javax.inject.Inject; | ||||
|
||||
import com.google.gwt.user.client.ui.IsWidget; | ||||
|
@@ -32,13 +33,17 @@ | |||
import org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionViewerPresenter; | ||||
import org.kie.workbench.common.stunner.core.client.annotation.DiagramEditor; | ||||
import org.kie.workbench.common.stunner.core.client.error.DiagramClientErrorHandler; | ||||
import org.kie.workbench.common.stunner.core.client.event.screen.ScreenMaximizedEvent; | ||||
import org.kie.workbench.common.stunner.core.client.event.screen.ScreenMinimizedEvent; | ||||
import org.kie.workbench.common.stunner.core.client.event.screen.ScreenPreMaximizedStateEvent; | ||||
import org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService; | ||||
import org.kie.workbench.common.stunner.core.client.service.ClientRuntimeError; | ||||
import org.kie.workbench.common.stunner.core.client.session.impl.EditorSession; | ||||
import org.kie.workbench.common.stunner.core.client.session.impl.ViewerSession; | ||||
import org.kie.workbench.common.stunner.core.documentation.DocumentationView; | ||||
import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramFocusEvent; | ||||
import org.kie.workbench.common.stunner.kogito.client.editor.event.OnDiagramLoseFocusEvent; | ||||
import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorExplorerScreen; | ||||
import org.kie.workbench.common.stunner.kogito.client.screens.DiagramEditorPropertiesScreen; | ||||
import org.kie.workbench.common.stunner.project.client.docks.StunnerDocksHandler; | ||||
import org.kie.workbench.common.stunner.project.client.editor.AbstractProjectDiagramEditor; | ||||
|
@@ -77,6 +82,8 @@ public class BPMNDiagramEditor extends AbstractProjectDiagramEditor<BPMNDiagramR | |||
|
||||
private Consumer<Boolean> saveCallback; | ||||
private boolean isMigrating = false; | ||||
private boolean isPropertiesOpenedBeforeMaximize = false; | ||||
private boolean isExplorerOpenedBeforeMaximize = false; | ||||
|
||||
@Inject | ||||
public BPMNDiagramEditor(final View view, | ||||
|
@@ -131,12 +138,53 @@ public String getEditorIdentifier() { | |||
|
||||
@OnOpen | ||||
public void onOpen() { | ||||
openPropertiesDocks(); | ||||
super.doOpen(); | ||||
} | ||||
|
||||
private void performDockOperation(final String id, final Consumer<? super UberfireDock> action) { | ||||
String currentPerspectiveIdentifier = perspectiveManager.getCurrentPerspective().getIdentifier(); | ||||
Collection<UberfireDock> stunnerDocks = stunnerDocksHandler.provideDocks(currentPerspectiveIdentifier); | ||||
|
||||
stunnerDocks.stream() | ||||
.filter(dock -> dock.getPlaceRequest().getIdentifier().compareTo(DiagramEditorPropertiesScreen.SCREEN_ID) == 0) | ||||
.forEach(uberfireDocks::open); | ||||
super.doOpen(); | ||||
.filter(dock -> dock.getPlaceRequest().getIdentifier().compareTo(id) == 0) | ||||
.forEach(action); | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
} | ||||
|
||||
public void openPropertiesDocks() { | ||||
performDockOperation(DiagramEditorPropertiesScreen.SCREEN_ID, uberfireDocks::open); | ||||
} | ||||
|
||||
public void closePropertiesDocks() { | ||||
performDockOperation(DiagramEditorPropertiesScreen.SCREEN_ID, uberfireDocks::close); | ||||
} | ||||
|
||||
public void openExplorerDocks() { | ||||
performDockOperation(DiagramEditorExplorerScreen.SCREEN_ID, uberfireDocks::open); | ||||
} | ||||
|
||||
public void closeExplorerDocks() { | ||||
performDockOperation(DiagramEditorExplorerScreen.SCREEN_ID, uberfireDocks::close); | ||||
} | ||||
|
||||
public void onScreenMaximizedEvent(@Observes ScreenMaximizedEvent event) { | ||||
isPropertiesOpenedBeforeMaximize = false; | ||||
isExplorerOpenedBeforeMaximize = false; | ||||
} | ||||
|
||||
public void onScreenPreMaximizedStateEvent(final @Observes ScreenPreMaximizedStateEvent event) { | ||||
// If Event Fired, it means the properties panel is active, hence it was open before maximized | ||||
isPropertiesOpenedBeforeMaximize = !event.isExplorerScreen(); | ||||
isExplorerOpenedBeforeMaximize = event.isExplorerScreen(); | ||||
} | ||||
|
||||
public void onScreenMinimizedEvent(@Observes ScreenMinimizedEvent event) { | ||||
if (isPropertiesOpenedBeforeMaximize) { | ||||
openPropertiesDocks(); | ||||
} else if (isExplorerOpenedBeforeMaximize) { | ||||
openExplorerDocks(); | ||||
} | ||||
} | ||||
|
||||
@OnClose | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.