From 4f60245e770c7e4964d1b964abc1eeef236ee372 Mon Sep 17 00:00:00 2001 From: "hyunsik.noh" Date: Sat, 23 Jul 2011 13:49:39 +0900 Subject: [PATCH] [inhouse]add highlight icon for package install and target info --- .../ide/connection/IExtensionPointAction.java | 2 +- .../com/samsung/ide/connection/ui/DeviceView.java | 28 ++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/com.samsung.ide.connection/src/com/samsung/ide/connection/IExtensionPointAction.java b/com.samsung.ide.connection/src/com/samsung/ide/connection/IExtensionPointAction.java index 87cb18a..897406c 100644 --- a/com.samsung.ide.connection/src/com/samsung/ide/connection/IExtensionPointAction.java +++ b/com.samsung.ide.connection/src/com/samsung/ide/connection/IExtensionPointAction.java @@ -6,5 +6,5 @@ import org.eclipse.swt.widgets.Shell; public interface IExtensionPointAction { ImageDescriptor getImageDescriptor(); String getActionText(); - void createDialog(Shell shell); + void createDialog(Shell shell, String target); } diff --git a/com.samsung.ide.connection/src/com/samsung/ide/connection/ui/DeviceView.java b/com.samsung.ide.connection/src/com/samsung/ide/connection/ui/DeviceView.java index 35b7fa3..269204a 100644 --- a/com.samsung.ide.connection/src/com/samsung/ide/connection/ui/DeviceView.java +++ b/com.samsung.ide.connection/src/com/samsung/ide/connection/ui/DeviceView.java @@ -1,7 +1,5 @@ package com.samsung.ide.connection.ui; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.concurrent.CopyOnWriteArrayList; import org.eclipse.core.commands.ExecutionException; @@ -143,23 +141,26 @@ public class DeviceView extends ViewPart { } }; stopAction.setImageDescriptor(loader.loadDescriptor("Emulator_stop.gif")); - stopAction.setEnabled(false); final IExtensionPointAction extAction = externalAction(); if ( extAction != null ) { + pkgAction = new Action(extAction.getActionText()){ public void run(){ + + IStructuredSelection selection = (IStructuredSelection)Connections.getSelection(); + final Device device = (Device)selection.getFirstElement(); + Shell shell = new Shell(); shell.setLocation(200, 200); shell.setSize(600, 400); - extAction.createDialog(shell); + extAction.createDialog(shell, device.getDeviceType()); } - }; pkgAction.setImageDescriptor(extAction.getImageDescriptor()); - pkgAction.setEnabled(true); } + placeActions(); } @@ -244,6 +245,19 @@ public class DeviceView extends ViewPart { startAction.setEnabled(start); stopAction.setEnabled(stop); + + if(pkgAction != null ) + { + IStructuredSelection selection = (IStructuredSelection)Connections.getSelection(); + if( !selection.toString().equals("")) + { + pkgAction.setEnabled(true); + } + else + { + pkgAction.setEnabled(false); + } + } } public TableViewer getViewer(){ @@ -300,7 +314,7 @@ public class DeviceView extends ViewPart { if(pkgAction != null) { toolBarManager.add(pkgAction); - pkgAction.setEnabled(true); + pkgAction.setEnabled(false); } } -- 2.7.4