Skip to content

Commit

Permalink
extracting webDeployment plugin deps into external file, this should r…
Browse files Browse the repository at this point in the history
…esolve #686
  • Loading branch information
Haehnchen committed Mar 3, 2016
1 parent a71b51f commit 626f8af
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
12 changes: 12 additions & 0 deletions META-INF/deployment-aware.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<idea-plugin url="https://www.jetbrains.com/idea">
<actions>

<action id="SymfonyWebDeploymentDownload"
class="fr.adrienbrault.idea.symfony2plugin.webDeployment.actions.SymfonyWebDeploymentDownloadAction">

<add-to-group group-id="PublishGroup" anchor="after" relative-to-action="PublishGroup.Download"/>
<add-to-group group-id="RemoteHostViewPopupMenu" anchor="after" relative-to-action="PublishGroup.Download"/>
</action>

</actions>
</idea-plugin>
14 changes: 2 additions & 12 deletions META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@

<depends optional="true">de.espend.idea.php.annotation</depends>
<depends optional="true">de.espend.idea.php.toolbox</depends>
<depends optional="true" config-file="deployment-aware.xml">com.jetbrains.plugins.webDeployment</depends>

<extensions defaultExtensionNs="de.espend.idea.php.annotation">
<PhpAnnotationReferenceProvider implementation="fr.adrienbrault.idea.symfony2plugin.templating.annotation.TemplateAnnotationReferences"/>
Expand Down Expand Up @@ -622,14 +623,6 @@
<add-to-group group-id="GenerateGroup" anchor="last" />
</action>

<action id="PublishGroup.SymfonySync" class="fr.adrienbrault.idea.symfony2plugin.webDeployment.actions.SymfonyWebDeploymentDownloadAction"
text="Download dev files"
icon="SymfonyIcons.Symfony"
description="Download Symfony service, routes, ... from dev folder">
<add-to-group group-id="PublishGroup" anchor="after" relative-to-action="PublishGroup.Download"/>
<add-to-group group-id="RemoteHostViewPopupMenu" anchor="after" relative-to-action="PublishGroup.Download"/>
</action>

<group id="Symfony2Group" text="Symfony" popup="false">
<group id="Symfony2GroupService" class="com.intellij.ide.actions.NonTrivialActionGroup" text="Service" popup="true" icon="SymfonyIcons.Symfony">
<action id="Symfony2NewXmlService" class="fr.adrienbrault.idea.symfony2plugin.action.NewXmlServiceAction"/>
Expand All @@ -644,10 +637,7 @@
<add-to-group group-id="NewGroup" anchor="last"/>
</group>

<action id="Symfony.WebTestCase" class="fr.adrienbrault.idea.symfony2plugin.action.bundle.WebTestCaseGeneratorAction"
text="Create WebTestCase"
icon="SymfonyIcons.Symfony"
description="Create WebTestCase class">
<action id="SymfonyWebTestCaseGenerator" class="fr.adrienbrault.idea.symfony2plugin.action.bundle.WebTestCaseGeneratorAction">
<add-to-group group-id="PhpUnitNewGroup" anchor="last"/>
</action>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class WebTestCaseGeneratorAction extends AbstractProjectDumbAwareAction {

public WebTestCaseGeneratorAction() {
super("WebTestCase", "WebTestCase", Symfony2Icons.SYMFONY);
super("Create WebTestCase", "Create WebTestCase class", Symfony2Icons.SYMFONY);
}

public void update(AnActionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@
import com.jetbrains.plugins.webDeployment.actions.WebDeploymentDataKeys;
import com.jetbrains.plugins.webDeployment.config.PublishConfig;
import com.jetbrains.plugins.webDeployment.config.WebServerConfig;
import fr.adrienbrault.idea.symfony2plugin.Symfony2Icons;
import fr.adrienbrault.idea.symfony2plugin.webDeployment.utils.RemoteWebServerUtil;
import org.jetbrains.annotations.NotNull;

public class SymfonyWebDeploymentDownloadAction extends DumbAwareAction {

public SymfonyWebDeploymentDownloadAction() {
super("Download dev files", "Download Symfony files from dev folder", Symfony2Icons.SYMFONY);
}

public void update(AnActionEvent e) {
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
if (project == null || project.isDisposed() || project.isDefault()) {
e.getPresentation().setVisible(false);
return;
}

WebServerConfig server = WebDeploymentDataKeys.SERVER_CONFIG.getData(e.getDataContext());
if(server == null || !PublishConfig.getInstance(project).isDefault(server)) {
if(server == null || !PublishConfig.getInstance(project).isDefault(server) || !server.needsTransfer() || server.validateFast() != null) {
e.getPresentation().setVisible(false);
return;
}
Expand Down

0 comments on commit 626f8af

Please sign in to comment.