[jbosstools-issues] [JBoss JIRA] (JBIDE-12703) Adding the runtime detection path manually

Lucia Jelinkova (JIRA) jira-events at lists.jboss.org
Mon Sep 24 09:56:34 EDT 2012


Lucia Jelinkova created JBIDE-12703:
---------------------------------------

             Summary: Adding the runtime detection path manually
                 Key: JBIDE-12703
                 URL: https://issues.jboss.org/browse/JBIDE-12703
             Project: Tools (JBoss Tools)
          Issue Type: Feature Request
          Components: runtime detection
    Affects Versions: 4.0.0.Alpha2
            Reporter: Lucia Jelinkova
            Assignee: Snjezana Peco
             Fix For: 4.0.0.Beta1


While writing my bot tests I need to add a runtime detection path manually (because there's a native window that cannot be operated by bot). There are some issues that I've come across. I am not sure if those are really issues or are intended so I am describing them here:

I add the path through the following code while the preferences dialog is open:
{code}
RuntimeUIActivator.getDefault().getModel().addRuntimePath(new RuntimePath(path));
{code}

However, the path is not added to the table, maybe because the table viewer is not refreshed:
{code}
runtimePathChangeListener = new IRuntimePathChangeListener() {
   public void changed() {
      Display.getDefault().asyncExec(new Runnable() {
         public void run() {
            if (runtimePathChangeListener != null) {
               viewer.setInput(RuntimeUIActivator.getRuntimePaths());
            }
	}
      });
   }
};
		RuntimeUIActivator.getDefault().getModel().addRuntimePathChangeListener(runtimePathChangeListener);
{code}

There used to be a workaround for this - to close the preferences and open it again. However, when I click the OK button, all runtime paths are taken from the table (not from the model) and stored to the preferences store - since the table has not been refreshed the table is empty and an empty list is stored. 

{code}
@Override
public boolean performOk() {
   RuntimeUIActivator.getDefault().getModel().setRuntimePaths(runtimePaths);		RuntimeUIActivator.getDefault().saveRuntimePreferences();
		return super.performOk();
}
{code}

This is even different behavior to the performApply method (I think those methods should have the same result). In this method the paths from model are stored to the preferences store. 

{code}
@Override
protected void performApply() {
   RuntimeUIActivator.getDefault().saveRuntimePreferences();
}
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list