problem with get debug configuration

Hi all, sorry for my bad English.
I write plugin and have a problem. I needing to get follow parametr HOST and PORT from Remote configuration, but how to this make? In IDEA OPEN API i dont found needing methods, please tell me where i can this look, or give me please sample examples.
THank you!

2 comments

You can obtain all Remote run configurations using the following code:
  RunManager.getInstance(project).getConfigurations(RemoteConfigurationType.getInstance())
Then select a desired configuration from the returned array, cast it to RemoteConfiguration and use PORT and HOST field.

Note that RemoteConfigurationType and RemoteConfiguration classes aren't part of the Open API so use they at your own risk. Also you need to add
idea.jar to the IntelliJ IDEA SDK used by your plugin module.

Hi all, sorry for my bad English.
  I write plugin and have a problem. I needing to get follow parametr HOST and PORT from Remote configuration, but how to this make? In IDEA OPEN API i dont found needing methods, please tell me where i can this look, or give me please sample examples.
  THank you!

>

---
Original message URL: http://devnet.jetbrains.net/message/5274051#5274051



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

So, thank you for replies, but i get parametrs following method:


private static RunConfiguration getRunConfiguration(AnActionEvent anActionEvent) throws NullPointerException
{
        Project project = (Project) anActionEvent.getDataContext().getData(DataConstantsEx.PROJECT);
        RunManager runManager = (RunManager) (project.getComponent(RUN_MMANAGER));
        RunnerAndConfigurationSettings racs = runManager.getSelectedConfiguration();
        RunConfiguration rc = racs.getConfiguration();
        String str;
        return rc;
    }
public static String getURLServer(AnActionEvent anActionEvent) throws NoSuchFieldException, IllegalAccessException {         RunConfiguration rc = getRunConfiguration(anActionEvent);         return (String) rc.getClass().getField(HOST).get(rc);     }     public static String getDebugPort(AnActionEvent anActionEvent) throws NoSuchFieldException, IllegalAccessException {         RunConfiguration rc = getRunConfiguration(anActionEvent);         return (String) rc.getClass().getField(PORT).get(rc);     }

0

Please sign in to leave a comment.