--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="com.samsung.ide.connection" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="com.samsung.ide.connection" id="actionForConnections" name="actionForConnections"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="actionForConnections"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="actionForConnections">
+ <complexType>
+ <attribute name="action" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":com.samsung.ide.connection.IEXTTEST"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
package com.samsung.ide.connection.ui;\r
\r
+import java.lang.reflect.InvocationTargetException;\r
+import java.lang.reflect.Method;\r
import java.util.concurrent.CopyOnWriteArrayList;\r
\r
import org.eclipse.core.commands.ExecutionException;\r
import org.eclipse.core.commands.IHandler;\r
+import org.eclipse.core.runtime.CoreException;\r
+import org.eclipse.core.runtime.IConfigurationElement;\r
+import org.eclipse.core.runtime.IExtension;\r
+import org.eclipse.core.runtime.IExtensionPoint;\r
import org.eclipse.core.runtime.ListenerList;\r
+import org.eclipse.core.runtime.Platform;\r
import org.eclipse.jface.action.Action;\r
import org.eclipse.jface.action.IToolBarManager;\r
import org.eclipse.jface.viewers.ArrayContentProvider;\r
import org.eclipse.swt.events.MouseListener;\r
import org.eclipse.swt.layout.GridData;\r
import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Shell;\r
import org.eclipse.swt.widgets.Table;\r
import org.eclipse.swt.widgets.TableColumn;\r
import org.eclipse.ui.IActionBars;\r
import org.eclipse.ui.part.ViewPart;\r
\r
import com.samsung.ide.connection.FreshConnectionActivator;\r
+import com.samsung.ide.connection.IExtensionPointAction;\r
import com.samsung.ide.connection.device.Device;\r
import com.samsung.ide.connection.device.DeviceLauncherManager;\r
import com.samsung.ide.connection.device.DeviceManager;\r
private TableViewer Connections;\r
private Action startAction;\r
private Action stopAction;\r
+ private Action pkgAction = null;\r
private ImageLoader loader;\r
\r
ListenerList listeners = new ListenerList();\r
try {\r
startHandler.execute(null);\r
} catch (ExecutionException e) {\r
- // TODO Auto-generated catch block\r
e.printStackTrace();\r
}\r
}\r
try {\r
stopHandler.execute(null);\r
} catch (ExecutionException e) {\r
- // TODO Auto-generated catch block\r
e.printStackTrace();\r
}\r
}\r
};\r
stopAction.setImageDescriptor(loader.loadDescriptor("Emulator_stop.gif"));\r
stopAction.setEnabled(false);\r
+ \r
+ final IExtensionPointAction extAction = externalAction();\r
+ if ( extAction != null )\r
+ {\r
+ pkgAction = new Action(extAction.getActionText()){\r
+ public void run(){\r
+ Shell shell = new Shell();\r
+ shell.setLocation(200, 200);\r
+ shell.setSize(600, 400);\r
+ extAction.createDialog(shell);\r
+ }\r
+\r
+ };\r
+ pkgAction.setImageDescriptor(extAction.getImageDescriptor());\r
+ pkgAction.setEnabled(true);\r
+ }\r
placeActions();\r
}\r
\r
startAction.setEnabled(true);\r
toolBarManager.add(stopAction);\r
stopAction.setEnabled(false);\r
+ if(pkgAction != null)\r
+ {\r
+ toolBarManager.add(pkgAction); \r
+ pkgAction.setEnabled(true);\r
+ }\r
}\r
\r
\r
public void setFocus() {\r
Connections.getControl().setFocus();\r
}\r
+ \r
+ public IExtensionPointAction externalAction()\r
+ {\r
+ IExtensionPointAction action = null;\r
+ if( action == null ) {\r
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry()\r
+ .getExtensionPoint(FreshConnectionActivator.PLUGIN_ID, "actionForConnections");\r
+ \r
+ action = null;\r
+ if (extensionPoint != null) {\r
+ IExtension[] extensions = extensionPoint.getExtensions();\r
+ if( extensions.length == 0)\r
+ return null;\r
+ for (IExtension ex : extensions) {\r
+ IConfigurationElement[] configElements = ex.getConfigurationElements();\r
+ for(int i=0;i<configElements.length;i++){\r
+ if(configElements[i].getName().equals("actionForConnections")){\r
+ try {\r
+ action = (IExtensionPointAction)(configElements[i].createExecutableExtension("action"));\r
+ } catch (CoreException e) {\r
+ e.printStackTrace();\r
+ }\r
+ \r
+ if(action!=null)\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return action;\r
+ }\r
}\r