This repository was archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
PRJ-285 JCEF support #111
Open
ARTI1208
wants to merge
7
commits into
master
Choose a base branch
from
jcef
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PRJ-285 JCEF support #111
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6405b64
Use intellij artifacts with sources
ARTI1208 bbe216f
Allow sending server events from client repo
ARTI1208 3a09f3f
Move build version testing function from server to client repo
ARTI1208 426403e
PRJ-285 Add jcef support
ARTI1208 6a56383
Simplify building with different Intellij Platform dependencies versions
ARTI1208 6ecad70
Use different path selectors for different products
ARTI1208 287d58e
Fix CEF-related errors on platform version below 202
ARTI1208 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
61 changes: 61 additions & 0 deletions
61
projector-server/src/main/kotlin/org/jetbrains/projector/server/CommonQueueEventSender.kt
This file contains hidden or 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,61 @@ | ||
| /* | ||
| * Copyright (c) 2019-2022, JetBrains s.r.o. and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. JetBrains designates this | ||
| * particular file as subject to the "Classpath" exception as provided | ||
| * by Oracle in the LICENSE file that accompanied this code. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact JetBrains, Na Hrebenech II 1718/10, Prague, 14000, Czech Republic | ||
| * if you need additional information or have any questions. | ||
| */ | ||
| @file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE") | ||
|
|
||
| package org.jetbrains.projector.server | ||
|
|
||
| import org.jetbrains.projector.awt.peer.PComponentPeer | ||
| import org.jetbrains.projector.common.EventSender | ||
| import org.jetbrains.projector.common.event.BrowserShowEventPart | ||
| import org.jetbrains.projector.common.event.ServerEventPart | ||
| import org.jetbrains.projector.common.protocol.toClient.ServerBrowserEvent | ||
| import org.jetbrains.projector.common.protocol.toClient.ServerEvent | ||
| import org.jetbrains.projector.util.loading.UseProjectorLoader | ||
| import sun.awt.AWTAccessor | ||
| import java.awt.Component | ||
| import java.awt.peer.ComponentPeer | ||
| import javax.swing.SwingUtilities | ||
|
|
||
| @UseProjectorLoader | ||
| class CommonQueueEventSender : EventSender { | ||
|
|
||
| override fun sendEvent(event: ServerEvent) { | ||
| ProjectorServer.appendToCommonQueue(event) | ||
| } | ||
|
|
||
| override fun sendEventPart(part: ServerEventPart) { | ||
| val serverEvent = when (part) { | ||
| is BrowserShowEventPart -> ServerBrowserEvent.ShowEvent(part.browserId, part.show, part.component?.pWindowId) | ||
| } | ||
|
|
||
| sendEvent(serverEvent) | ||
| } | ||
|
|
||
| private val Component.pWindowId: Int? | ||
| get() = let { | ||
| val root = SwingUtilities.getRoot(it) ?: return@let null | ||
| val peer = AWTAccessor.getComponentAccessor().getPeer<ComponentPeer>(root) as? PComponentPeer ?: return@let null | ||
| peer.pWindow.id | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
24 changes: 24 additions & 0 deletions
24
...or-server/src/main/resources/META-INF/services/org.jetbrains.projector.common.EventSender
This file contains hidden or 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,24 @@ | ||
| # | ||
| # Copyright (c) 2019-2022, JetBrains s.r.o. and/or its affiliates. All rights reserved. | ||
| # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| # | ||
| # This code is free software; you can redistribute it and/or modify it | ||
| # under the terms of the GNU General Public License version 2 only, as | ||
| # published by the Free Software Foundation. JetBrains designates this | ||
| # particular file as subject to the "Classpath" exception as provided | ||
| # by Oracle in the LICENSE file that accompanied this code. | ||
| # | ||
| # This code is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| # version 2 for more details (a copy is included in the LICENSE file that | ||
| # accompanied this code). | ||
| # | ||
| # You should have received a copy of the GNU General Public License version | ||
| # 2 along with this work; if not, write to the Free Software Foundation, | ||
| # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| # | ||
| # Please contact JetBrains, Na Hrebenech II 1718/10, Prague, 14000, Czech Republic | ||
| # if you need additional information or have any questions. | ||
| # | ||
| org.jetbrains.projector.server.CommonQueueEventSender | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -49,10 +49,11 @@ val localProperties = Properties().apply { | |
| if (localProperties["useLocalProjectorClient"] == "true") { | ||
| includeBuild("../projector-client") { | ||
| dependencySubstitution { | ||
| substitute(module("$projectorClientGroup:projector-common")).with(project(":projector-common")) | ||
| substitute(module("$projectorClientGroup:projector-server-core")).with(project(":projector-server-core")) | ||
| substitute(module("$projectorClientGroup:projector-util-loading")).with(project(":projector-util-loading")) | ||
| substitute(module("$projectorClientGroup:projector-util-logging")).with(project(":projector-util-logging")) | ||
| substitute(module("$projectorClientGroup:projector-common")).using(project(":projector-common")) | ||
| substitute(module("$projectorClientGroup:projector-ij-common")).using(project(":projector-ij-common")) | ||
| substitute(module("$projectorClientGroup:projector-server-core")).using(project(":projector-server-core")) | ||
| substitute(module("$projectorClientGroup:projector-util-loading")).using(project(":projector-util-loading")) | ||
| substitute(module("$projectorClientGroup:projector-util-logging")).using(project(":projector-util-logging")) | ||
|
Comment on lines
+52
to
+56
Member
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. Why changing |
||
| } | ||
| } | ||
| } | ||
|
|
||
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.
Why do we need to declare such a file and inject event sender via it? Could we use some easier way of injection, like we do in other places?