Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
2baac69a
Commit
2baac69a
authored
6 years ago
by
Vladimir Krivosheev
Browse files
Options
Download
Email Patches
Plain Diff
request FileEditorManager on demand
parent
8a1b0f60
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
platform/platform-impl/src/com/intellij/designer/LightToolWindowManager.java
+4
-20
...mpl/src/com/intellij/designer/LightToolWindowManager.java
plugins/ui-designer-core/src/com/intellij/designer/AbstractToolWindowManager.java
+4
-18
.../src/com/intellij/designer/AbstractToolWindowManager.java
plugins/ui-designer-core/src/com/intellij/designer/DesignerToolWindowManager.java
+3
-18
.../src/com/intellij/designer/DesignerToolWindowManager.java
plugins/ui-designer-core/src/com/intellij/designer/palette/PaletteToolWindowManager.java
+3
-18
...m/intellij/designer/palette/PaletteToolWindowManager.java
plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteToolWindowManager.java
+4
-18
...m/intellij/ide/palette/impl/PaletteToolWindowManager.java
plugins/ui-designer/src/com/intellij/uiDesigner/AbstractToolWindowManager.java
+3
-18
...rc/com/intellij/uiDesigner/AbstractToolWindowManager.java
plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/DesignerToolWindowManager.java
+4
-18
...Designer/propertyInspector/DesignerToolWindowManager.java
with
25 additions
and
128 deletions
+25
-128
platform/platform-impl/src/com/intellij/designer/LightToolWindowManager.java
+
4
-
20
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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
com.intellij.designer
;
package
com.intellij.designer
;
import
com.intellij.ide.util.PropertiesComponent
;
import
com.intellij.ide.util.PropertiesComponent
;
...
@@ -49,7 +35,6 @@ public abstract class LightToolWindowManager implements Disposable {
...
@@ -49,7 +35,6 @@ public abstract class LightToolWindowManager implements Disposable {
private
final
MergingUpdateQueue
myWindowQueue
=
new
MergingUpdateQueue
(
getComponentName
(),
200
,
true
,
null
,
this
);
private
final
MergingUpdateQueue
myWindowQueue
=
new
MergingUpdateQueue
(
getComponentName
(),
200
,
true
,
null
,
this
);
protected
final
Project
myProject
;
protected
final
Project
myProject
;
protected
final
FileEditorManager
myFileEditorManager
;
protected
volatile
ToolWindow
myToolWindow
;
protected
volatile
ToolWindow
myToolWindow
;
private
final
PropertiesComponent
myPropertiesComponent
;
private
final
PropertiesComponent
myPropertiesComponent
;
...
@@ -59,9 +44,8 @@ public abstract class LightToolWindowManager implements Disposable {
...
@@ -59,9 +44,8 @@ public abstract class LightToolWindowManager implements Disposable {
private
MessageBusConnection
myConnection
;
private
MessageBusConnection
myConnection
;
protected
LightToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
protected
LightToolWindowManager
(
Project
project
)
{
myProject
=
project
;
myProject
=
project
;
myFileEditorManager
=
fileEditorManager
;
myPropertiesComponent
=
PropertiesComponent
.
getInstance
(
myProject
);
myPropertiesComponent
=
PropertiesComponent
.
getInstance
(
myProject
);
myEditorModeKey
=
EDITOR_MODE
+
getComponentName
()
+
".STATE"
;
myEditorModeKey
=
EDITOR_MODE
+
getComponentName
()
+
".STATE"
;
...
@@ -109,7 +93,7 @@ public abstract class LightToolWindowManager implements Disposable {
...
@@ -109,7 +93,7 @@ public abstract class LightToolWindowManager implements Disposable {
@Nullable
@Nullable
public
DesignerEditorPanelFacade
getActiveDesigner
()
{
public
DesignerEditorPanelFacade
getActiveDesigner
()
{
for
(
FileEditor
editor
:
my
FileEditorManager
.
getSelectedEditors
())
{
for
(
FileEditor
editor
:
FileEditorManager
.
getInstance
(
myProject
).
getSelectedEditors
())
{
DesignerEditorPanelFacade
designer
=
getDesigner
(
editor
);
DesignerEditorPanelFacade
designer
=
getDesigner
(
editor
);
if
(
designer
!=
null
)
{
if
(
designer
!=
null
)
{
return
designer
;
return
designer
;
...
@@ -231,7 +215,7 @@ public abstract class LightToolWindowManager implements Disposable {
...
@@ -231,7 +215,7 @@ public abstract class LightToolWindowManager implements Disposable {
private
final
Consumer
<
DesignerEditorPanelFacade
>
myDisposeAction
=
designer
->
disposeContent
(
designer
);
private
final
Consumer
<
DesignerEditorPanelFacade
>
myDisposeAction
=
designer
->
disposeContent
(
designer
);
private
void
runUpdateContent
(
Consumer
<?
super
DesignerEditorPanelFacade
>
action
)
{
private
void
runUpdateContent
(
Consumer
<?
super
DesignerEditorPanelFacade
>
action
)
{
for
(
FileEditor
editor
:
my
FileEditorManager
.
getAllEditors
())
{
for
(
FileEditor
editor
:
FileEditorManager
.
getInstance
(
myProject
).
getAllEditors
())
{
DesignerEditorPanelFacade
designer
=
getDesigner
(
editor
);
DesignerEditorPanelFacade
designer
=
getDesigner
(
editor
);
if
(
designer
!=
null
)
{
if
(
designer
!=
null
)
{
action
.
accept
(
designer
);
action
.
accept
(
designer
);
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer-core/src/com/intellij/designer/AbstractToolWindowManager.java
+
4
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2012 JetBrains s.r.o.
*
* 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
com.intellij.designer
;
package
com.intellij.designer
;
import
com.intellij.designer.palette.PaletteToolWindowManager
;
import
com.intellij.designer.palette.PaletteToolWindowManager
;
import
com.intellij.openapi.fileEditor.FileEditor
;
import
com.intellij.openapi.fileEditor.FileEditor
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
org.jetbrains.annotations.Nullable
;
/**
/**
* @author Alexander Lobas
* @author Alexander Lobas
*/
*/
public
abstract
class
AbstractToolWindowManager
extends
LightToolWindowManager
{
public
abstract
class
AbstractToolWindowManager
extends
LightToolWindowManager
{
protected
AbstractToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
protected
AbstractToolWindowManager
(
@NotNull
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
}
}
@Nullable
@Nullable
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer-core/src/com/intellij/designer/DesignerToolWindowManager.java
+
3
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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
com.intellij.designer
;
package
com.intellij.designer
;
import
com.intellij.designer.designSurface.DesignerEditorPanel
;
import
com.intellij.designer.designSurface.DesignerEditorPanel
;
import
com.intellij.icons.AllIcons
;
import
com.intellij.icons.AllIcons
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
...
@@ -42,8 +27,8 @@ public final class DesignerToolWindowManager extends AbstractToolWindowManager {
...
@@ -42,8 +27,8 @@ public final class DesignerToolWindowManager extends AbstractToolWindowManager {
//
//
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
public
DesignerToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
public
DesignerToolWindowManager
(
@NotNull
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
}
}
public
static
DesignerToolWindow
getInstance
(
DesignerEditorPanel
designer
)
{
public
static
DesignerToolWindow
getInstance
(
DesignerEditorPanel
designer
)
{
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer-core/src/com/intellij/designer/palette/PaletteToolWindowManager.java
+
3
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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
com.intellij.designer.palette
;
package
com.intellij.designer.palette
;
import
com.intellij.designer.AbstractToolWindowManager
;
import
com.intellij.designer.AbstractToolWindowManager
;
...
@@ -21,7 +7,6 @@ import com.intellij.designer.DesignerEditorPanelFacade;
...
@@ -21,7 +7,6 @@ import com.intellij.designer.DesignerEditorPanelFacade;
import
com.intellij.designer.LightToolWindow
;
import
com.intellij.designer.LightToolWindow
;
import
com.intellij.designer.designSurface.DesignerEditorPanel
;
import
com.intellij.designer.designSurface.DesignerEditorPanel
;
import
com.intellij.icons.AllIcons
;
import
com.intellij.icons.AllIcons
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
...
@@ -43,8 +28,8 @@ public class PaletteToolWindowManager extends AbstractToolWindowManager {
...
@@ -43,8 +28,8 @@ public class PaletteToolWindowManager extends AbstractToolWindowManager {
//
//
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
public
PaletteToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
public
PaletteToolWindowManager
(
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
}
}
public
static
PalettePanel
getInstance
(
DesignerEditorPanel
designer
)
{
public
static
PalettePanel
getInstance
(
DesignerEditorPanel
designer
)
{
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteToolWindowManager.java
+
4
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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
com.intellij.ide.palette.impl
;
package
com.intellij.ide.palette.impl
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
...
@@ -22,7 +8,6 @@ import com.intellij.ide.IdeBundle;
...
@@ -22,7 +8,6 @@ import com.intellij.ide.IdeBundle;
import
com.intellij.openapi.actionSystem.AnAction
;
import
com.intellij.openapi.actionSystem.AnAction
;
import
com.intellij.openapi.actionSystem.DefaultActionGroup
;
import
com.intellij.openapi.actionSystem.DefaultActionGroup
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
...
@@ -40,8 +25,9 @@ import org.jetbrains.annotations.Nullable;
...
@@ -40,8 +25,9 @@ import org.jetbrains.annotations.Nullable;
public
class
PaletteToolWindowManager
extends
AbstractToolWindowManager
{
public
class
PaletteToolWindowManager
extends
AbstractToolWindowManager
{
private
final
PaletteWindow
myToolWindowPanel
;
private
final
PaletteWindow
myToolWindowPanel
;
public
PaletteToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
public
PaletteToolWindowManager
(
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
myToolWindowPanel
=
ApplicationManager
.
getApplication
().
isHeadlessEnvironment
()
?
null
:
new
PaletteWindow
(
project
);
myToolWindowPanel
=
ApplicationManager
.
getApplication
().
isHeadlessEnvironment
()
?
null
:
new
PaletteWindow
(
project
);
if
(
myToolWindowPanel
!=
null
)
{
if
(
myToolWindowPanel
!=
null
)
{
Disposer
.
register
(
this
,
()
->
myToolWindowPanel
.
dispose
());
Disposer
.
register
(
this
,
()
->
myToolWindowPanel
.
dispose
());
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer/src/com/intellij/uiDesigner/AbstractToolWindowManager.java
+
3
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2018 JetBrains s.r.o.
*
* 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
com.intellij.uiDesigner
;
package
com.intellij.uiDesigner
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
...
@@ -20,7 +6,6 @@ import com.intellij.designer.LightToolWindowManager;
...
@@ -20,7 +6,6 @@ import com.intellij.designer.LightToolWindowManager;
import
com.intellij.designer.ToggleEditorModeAction
;
import
com.intellij.designer.ToggleEditorModeAction
;
import
com.intellij.ide.palette.impl.PaletteToolWindowManager
;
import
com.intellij.ide.palette.impl.PaletteToolWindowManager
;
import
com.intellij.openapi.fileEditor.FileEditor
;
import
com.intellij.openapi.fileEditor.FileEditor
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.uiDesigner.editor.UIFormEditor
;
import
com.intellij.uiDesigner.editor.UIFormEditor
;
...
@@ -31,8 +16,8 @@ import org.jetbrains.annotations.Nullable;
...
@@ -31,8 +16,8 @@ import org.jetbrains.annotations.Nullable;
* @author Alexander Lobas
* @author Alexander Lobas
*/
*/
public
abstract
class
AbstractToolWindowManager
extends
LightToolWindowManager
{
public
abstract
class
AbstractToolWindowManager
extends
LightToolWindowManager
{
protected
AbstractToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
protected
AbstractToolWindowManager
(
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
}
}
@Nullable
@Nullable
...
...
This diff is collapsed.
Click to expand it.
plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/DesignerToolWindowManager.java
+
4
-
18
View file @
2baac69a
/*
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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
com.intellij.uiDesigner.propertyInspector
;
package
com.intellij.uiDesigner.propertyInspector
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
import
com.intellij.designer.DesignerEditorPanelFacade
;
...
@@ -20,7 +6,6 @@ import com.intellij.designer.LightToolWindow;
...
@@ -20,7 +6,6 @@ import com.intellij.designer.LightToolWindow;
import
com.intellij.icons.AllIcons
;
import
com.intellij.icons.AllIcons
;
import
com.intellij.openapi.Disposable
;
import
com.intellij.openapi.Disposable
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.fileEditor.FileEditorManager
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.util.Disposer
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
import
com.intellij.openapi.wm.ToolWindowAnchor
;
...
@@ -40,8 +25,9 @@ import org.jetbrains.annotations.Nullable;
...
@@ -40,8 +25,9 @@ import org.jetbrains.annotations.Nullable;
public
class
DesignerToolWindowManager
extends
AbstractToolWindowManager
implements
Disposable
{
public
class
DesignerToolWindowManager
extends
AbstractToolWindowManager
implements
Disposable
{
private
final
DesignerToolWindow
myToolWindowPanel
;
private
final
DesignerToolWindow
myToolWindowPanel
;
public
DesignerToolWindowManager
(
Project
project
,
FileEditorManager
fileEditorManager
)
{
public
DesignerToolWindowManager
(
@NotNull
Project
project
)
{
super
(
project
,
fileEditorManager
);
super
(
project
);
myToolWindowPanel
=
ApplicationManager
.
getApplication
().
isHeadlessEnvironment
()
?
null
:
new
DesignerToolWindow
(
project
);
myToolWindowPanel
=
ApplicationManager
.
getApplication
().
isHeadlessEnvironment
()
?
null
:
new
DesignerToolWindow
(
project
);
if
(
myToolWindowPanel
!=
null
)
{
if
(
myToolWindowPanel
!=
null
)
{
Disposer
.
register
(
this
,
()
->
myToolWindowPanel
.
dispose
());
Disposer
.
register
(
this
,
()
->
myToolWindowPanel
.
dispose
());
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help