nameFilter="*"
objectClass="org.tizen.sdblib.service.FileEntry">
</page>
- <page
- class="org.tizen.common.connection.properties.ConnectionExplorerPermissionPropertyPages"
- id="org.tizen.common.connection.properties.Permission"
- name="%properties.page.permission"
- nameFilter="*"
- objectClass="org.tizen.sdblib.service.FileEntry">
+ <page
+ class="org.tizen.common.connection.properties.ConnectionExplorerPermissionPropertyPages"
+ id="org.tizen.common.connection.properties.Permission"
+ name="%properties.page.permission"
+ nameFilter="*"
+ objectClass="org.tizen.sdblib.service.FileEntry">
</page>
</extension>
<extension
import java.util.ArrayList;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
-
super.start(context);
plugin = this;
- if (OSChecker.isWindows())
- {
+ if (OSChecker.isWindows()) {
this.os = WINDOWS;
}
- else
- {
+ else {
this.os = LINUX;
}
+ IAdapterManager manager = Platform.getAdapterManager();
+ // properties adapters
+ IAdapterFactory factory = new FileEntryAdapterFactory();
+ manager.registerAdapters(factory, FileEntry.class);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
*/
plugin = null;
int deviceCnt = SmartDevelopmentBridge.getBridge().getDevices().length;
- if (deviceCnt==0)
- {
+ if (deviceCnt == 0) {
SmartDevelopmentBridge.disconnectBridge();
}
super.stop(context);
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hoon Kang <h245.kang@samsung.com>
+ * Hyunsik Noh <hyunsik.noh@samsung.com>
+ *
+ * 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;
+ }
+}
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hoon Kang <h245.kang@samsung.com>
+ * Hyunsik Noh <hyunsik.noh@samsung.com>
+ *
+ * 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 };
+ }
+}