mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 17:57:53 +08:00
Stop teaching people to use components (#233)
- Replace documentation on writing components with documentation on migrating away from components - Split documentation on extensions and extension points (extensions are always needed and EPs are quite uncommon) - Add documentation on listeners - Remove application and project components in sample plugins whenever possible
This commit is contained in:
parent
4fa02cd04e
commit
35bc0962b5
@ -28,31 +28,6 @@
|
|||||||
<!-- Resource bundle from which the text of plugin descriptions, action names and etc. will be loaded -->
|
<!-- Resource bundle from which the text of plugin descriptions, action names and etc. will be loaded -->
|
||||||
<resource-bundle>org.jetbrains.tutorials.sample.PluginSampleBundle</resource-bundle>
|
<resource-bundle>org.jetbrains.tutorials.sample.PluginSampleBundle</resource-bundle>
|
||||||
|
|
||||||
<!-- Plugin's application components -->
|
|
||||||
<application-components>
|
|
||||||
<component>
|
|
||||||
<!-- Component's interface class -->
|
|
||||||
<interface-class>org.jetbrains.tutorials.sample.DummyApplicationComponent</interface-class>
|
|
||||||
<!-- Component's implementation class -->
|
|
||||||
<implementation-class>org.jetbrains.tutorials.sample.DummyApplicationComponentImpl</implementation-class>
|
|
||||||
</component>
|
|
||||||
</application-components>
|
|
||||||
|
|
||||||
<!-- Plugin's project components -->
|
|
||||||
<project-components>
|
|
||||||
<component>
|
|
||||||
<!-- Interface and implementation classes are the same -->
|
|
||||||
<interface-class>org.jetbrains.tutorials.sample.DummyProjectComponent</interface-class>
|
|
||||||
<implementation-class>org.jetbrains.tutorials.sample.DummyProjectComponentImpl</implementation-class>
|
|
||||||
<!-- If the "workspace" option is set "true", the component saves its state to the .iws file
|
|
||||||
instead of the .ipr file. Note that the <option> element is used only if the component implements the JDOMExternalizable interface. Otherwise, the use of the <option> element takes no effect.-->
|
|
||||||
|
|
||||||
<option name="workspace" value="true"/>
|
|
||||||
<!-- If the "loadForDefaultProject" tag is present, the project component is instantiated also for the default project. -->
|
|
||||||
<loadForDefaultProject/>
|
|
||||||
</component>
|
|
||||||
</project-components>
|
|
||||||
|
|
||||||
<!-- Actions -->
|
<!-- Actions -->
|
||||||
<actions>
|
<actions>
|
||||||
<!-- The <action> element defines an action to register.
|
<!-- The <action> element defines an action to register.
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
package org.jetbrains.tutorials.sample;
|
|
||||||
|
|
||||||
import com.intellij.openapi.components.BaseComponent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Anna Bulenkova
|
|
||||||
*/
|
|
||||||
interface DummyApplicationComponent extends BaseComponent {
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package org.jetbrains.tutorials.sample;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Anna Bulenkova
|
|
||||||
*/
|
|
||||||
public class DummyApplicationComponentImpl implements DummyApplicationComponent {
|
|
||||||
@Override
|
|
||||||
public void initComponent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void disposeComponent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public String getComponentName() {
|
|
||||||
return "DummyApplicationComponent";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
package org.jetbrains.tutorials.sample;
|
|
||||||
|
|
||||||
import com.intellij.openapi.components.ProjectComponent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Anna Bulenkova
|
|
||||||
*/
|
|
||||||
public interface DummyProjectComponent extends ProjectComponent {
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package org.jetbrains.tutorials.sample;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Anna Bulenkova
|
|
||||||
*/
|
|
||||||
public class DummyProjectComponentImpl implements DummyProjectComponent {
|
|
||||||
@Override
|
|
||||||
public void projectOpened() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void projectClosed() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initComponent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void disposeComponent() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public String getComponentName() {
|
|
||||||
return "DummyProjectComponent";
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user