import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.tizen.common.connection.debugtools.DebugTool;
+import org.tizen.common.connection.preference.TizenConnectionExplorerPreferencePage;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.common.util.FileUtil;
import org.tizen.common.util.OSChecker;
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
+ */
+ @Override
+ protected void initializeDefaultPreferences( final IPreferenceStore store ) {
+ store.setDefault(TizenConnectionExplorerPreferencePage.KEY_PUSHPULL_TIMEOUT, TizenConnectionExplorerPreferencePage.VALUE_PUSHPULL_TIMEOUT_DEFAULT);
+ }
public static synchronized List<DebugTool> getDebugTools(IDevice device) {
List<DebugTool> toolLists = new ArrayList<DebugTool>();
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@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.preference;
+
+import org.eclipse.osgi.util.NLS;
+
+public class PreferenceMessages {
+
+ private static final String BUNDLE_NAME = PreferenceMessages.class.getName();//$NON-NLS-1$
+
+ public static String CONNECTION_EXPLORER_DESCRIPTION;
+ public static String CONNECTION_EXPLORER_GROUP_TIMEOUT;
+ public static String CONNECTION_EXPLORER_TIMEOUT_DESCRIPTION;
+ public static String CONNECTION_EXPLORER_LABEL_TIMEOUT;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages( BUNDLE_NAME, PreferenceMessages.class );
+ }
+}
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@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.preference;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.tizen.common.connection.ConnectionPlugin;
+
+
+public class
+TizenConnectionExplorerPreferencePage
+extends FieldEditorPreferencePage
+implements IWorkbenchPreferencePage
+{
+ public static final String KEY_PUSHPULL_TIMEOUT = "pushpull_timeout"; //$NON-NLS-1$
+ public static final int VALUE_PUSHPULL_TIMEOUT_DEFAULT = 5000;
+
+ public TizenConnectionExplorerPreferencePage() {
+ setPreferenceStore( ConnectionPlugin.getDefault().getPreferenceStore() );
+ setDescription( PreferenceMessages.CONNECTION_EXPLORER_DESCRIPTION );
+ }
+
+
+ @Override
+ public void init(IWorkbench workbench) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ Composite composite = getFieldEditorParent();
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ composite.setLayout( layout );
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.verticalAlignment = GridData.FILL;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData( data );
+ createSpacer( composite, 1 );
+ createPushPullTimeoutPreferences( composite );
+ }
+
+ protected void createSpacer( Composite composite, int columnSpan ) {
+ Label label = new Label( composite, SWT.NONE );
+ GridData gd = new GridData();
+ gd.horizontalSpan = columnSpan;
+ label.setLayoutData( gd );
+ }
+
+ private void createPushPullTimeoutPreferences( Composite parent ) {
+ Composite comp = createGroup( parent, PreferenceMessages.CONNECTION_EXPLORER_GROUP_TIMEOUT, 1 );
+ Label desc = new Label(comp, SWT.NONE);
+ desc.setText(PreferenceMessages.CONNECTION_EXPLORER_TIMEOUT_DESCRIPTION);
+ Composite formatComposite = createCompositeEx( comp, 1, GridData.FILL_HORIZONTAL);
+ IntegerFieldEditor intField = new IntegerFieldEditor(KEY_PUSHPULL_TIMEOUT, PreferenceMessages.CONNECTION_EXPLORER_LABEL_TIMEOUT, formatComposite);
+ addField(intField);
+ }
+
+ private Composite createCompositeEx(Composite parent, int numColumns, int layoutMode) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setFont(parent.getFont());
+
+ composite.setLayout(new GridLayout(numColumns, true));
+ composite.setLayoutData(new GridData(layoutMode));
+ return composite;
+ }
+ private Group createGroup(Composite parent, String label, int nColumns) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setFont(parent.getFont());
+ group.setText(label);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = nColumns;
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ return group;
+ }
+}