-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major updates to layout for all views. Accordion in navbar removed. L…
…ogo moved to navbar. Content pane left justified.
- Loading branch information
Showing
13 changed files
with
94 additions
and
141 deletions.
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
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
50 changes: 50 additions & 0 deletions
50
src/main/java/org/cftoolsuite/ui/view/BaseStreamingView.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,50 @@ | ||
package org.cftoolsuite.ui.view; | ||
|
||
import com.vaadin.flow.component.Key; | ||
import com.vaadin.flow.component.UI; | ||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.notification.Notification; | ||
import com.vaadin.flow.component.notification.Notification.Position; | ||
import com.vaadin.flow.component.notification.NotificationVariant; | ||
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | ||
import org.cftoolsuite.client.SanfordStreamingClient; | ||
|
||
public abstract class BaseStreamingView extends VerticalLayout { | ||
|
||
protected SanfordStreamingClient sanfordStreamingClient; | ||
|
||
public BaseStreamingView(SanfordStreamingClient sanfordStreamingClient) { | ||
this.sanfordStreamingClient = sanfordStreamingClient; | ||
setupUI(); | ||
} | ||
|
||
protected abstract void setupUI(); | ||
|
||
protected abstract void clearAllFields(); | ||
|
||
protected void showNotification(String message, NotificationVariant variant) { | ||
Notification notification = new Notification(message, 5000, Position.TOP_STRETCH); | ||
notification.setPosition(Position.TOP_CENTER); | ||
notification.addThemeVariants(variant); | ||
|
||
Div content = new Div(); | ||
content.setText(message); | ||
content.getStyle().set("cursor", "pointer"); | ||
content.addClickListener(event -> notification.close()); | ||
|
||
notification.add(content); | ||
|
||
UI.getCurrent().addShortcutListener( | ||
notification::close, | ||
Key.ESCAPE | ||
); | ||
|
||
notification.open(); | ||
|
||
notification.addDetachListener(event -> | ||
UI.getCurrent().getPage().executeJs( | ||
"window.Vaadin.Flow.notificationEscListener.remove()" | ||
) | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.