From: kh5325.kim Date: Thu, 5 Sep 2013 02:48:23 +0000 (+0900) Subject: Added IWorkbenchAdapter for properties X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55ea54607d1458b457a23988911c65581f80a388;p=sdk%2Fide%2Fcommon-eplugin.git Added IWorkbenchAdapter for properties --- diff --git a/org.tizen.common.connection/plugin.xml b/org.tizen.common.connection/plugin.xml index bc93d12..639cffd 100644 --- a/org.tizen.common.connection/plugin.xml +++ b/org.tizen.common.connection/plugin.xml @@ -122,12 +122,12 @@ nameFilter="*" objectClass="org.tizen.sdblib.service.FileEntry"> - + + * Hyunsik Noh + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.common.connection; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.model.IWorkbenchAdapter; +import org.tizen.sdblib.service.FileEntry; + +/** + * The Adapter class for providing the properties. + */ +public class FileEntryAdapter implements IWorkbenchAdapter { + @Override + public Object[] getChildren(Object o) { + return null; + } + + @Override + public ImageDescriptor getImageDescriptor(Object object) { + return null; + } + + @Override + public String getLabel(Object o) { + if (o instanceof FileEntry) + return ((FileEntry) o).getName(); + return null; + } + + @Override + public Object getParent(Object o) { + return null; + } +} diff --git a/org.tizen.common.connection/src/org/tizen/common/connection/FileEntryAdapterFactory.java b/org.tizen.common.connection/src/org/tizen/common/connection/FileEntryAdapterFactory.java new file mode 100644 index 0000000..772c770 --- /dev/null +++ b/org.tizen.common.connection/src/org/tizen/common/connection/FileEntryAdapterFactory.java @@ -0,0 +1,53 @@ +/* + * Common + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Hoon Kang + * Hyunsik Noh + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.common.connection; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.ui.model.IWorkbenchAdapter; +import org.tizen.sdblib.service.FileEntry; + +/** + * The AdapterFactory class for providing the properties. + */ +public class FileEntryAdapterFactory implements IAdapterFactory { + private Object fileEntryAdapter = new FileEntryAdapter(); + + @Override + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adapterType == IWorkbenchAdapter.class) { + if (adaptableObject instanceof FileEntry) { + return fileEntryAdapter; + } + } + return null; + } + + @Override + public Class[] getAdapterList() { + return new Class[] { IWorkbenchAdapter.class }; + } +}