properties.page.info = Info
properties.page.permission = Permission
-tools.name = Tools
connectionexplorer.name = Connection Explorer
log.name = Log
restorable="true">
</view>
</extension>
-
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- class="org.tizen.common.connection.preference.TizenToolsPreferencePage"
- id="org.tizen.common.connection.preferences.tizentools"
- name="%tools.name"
- category="org.tizen.common.preferences.tizencommon">
- </page>
- </extension>
-
+
<extension
point="org.eclipse.ui.preferencePages">
<page
class="org.tizen.common.connection.preference.TizenConnectionExplorerPreferencePage"
id="org.tizen.common.connection.preferences.tizenconnectionexplorer"
name="%connectionexplorer.name"
- category="org.tizen.common.connection.preferences.tizentools">
+ category="org.tizen.common.preferences.tizentools">
</page>
</extension>
- <!--<extension
- point="org.eclipse.ui.preferencePages">
- <page
- class="org.tizen.common.connection.preference.TizenLogPreferencePage"
- id="org.tizen.common.connection.preferences.tizenlog"
- name="%log.name"
- category="org.tizen.common.connection.preferences.tizentools">
- </page>
- </extension>-->
-
- <extension
+ <extension
point="org.eclipse.ui.views">
<view
name="%view.log"
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.common.ui.preferences.messages"; //$NON-NLS-1$
+
private Messages() {
}
public static String AppearancePreferencePage_TodShowOnStartup;
static {
- NLS.initializeMessages(Messages.class.getName(), Messages.class);
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
}
org.tizen.common.preferences.logging.name = Logging
preferences.logger.name = Tizen Logger
+org.tizen.common.preferences.tools.name = Tools
+org.tizen.common.preferences.sdb.name = Smart Development Bridge
+
extension-point.crashreporter = Crash Reporter
extension-point.prompter = Prompter
extension-point.project = ITizenProject Adapter
id="org.tizen.common.preferences.logging"\r
name="%org.tizen.common.preferences.logging.name">\r
</page>\r
+ <page\r
+ class="org.tizen.common.ui.page.preference.TizenToolsPreferencePage"\r
+ id="org.tizen.common.preferences.tizentools"\r
+ name="%org.tizen.common.preferences.tools.name"\r
+ category="org.tizen.common.preferences.tizencommon">\r
+ </page>\r
+ <page\r
+ class="org.tizen.common.ui.page.preference.SdbPreferencePage"\r
+ id="org.tizen.common.connection.preferences.sdb"\r
+ name="%org.tizen.common.preferences.sdb.name"\r
+ category="org.tizen.common.preferences.tizentools">\r
+ </page>\r
</extension>\r
<extension\r
point="org.eclipse.ui.startup">\r
import org.tizen.common.core.command.prompter.EclipsePrompter;
import org.tizen.common.core.command.prompter.SWTPrompter;
import org.tizen.common.rds.ui.preference.RdsPreferencePage;
+import org.tizen.common.ui.page.preference.SdbPreferencePage;
import org.tizen.common.ui.page.preference.TizenBasePreferencePage;
import org.tizen.common.util.DialogUtil;
import org.tizen.common.util.HostUtil;
// RDS settings
store.setDefault(RdsPreferencePage.RDS_OPTION_ID, RdsPreferencePage.RDS_MODE_DEFAULT);
+ // SDB settings
+ store.setDefault(SdbPreferencePage.KEY_SDB_RESPONSE_TIMEOUT, SdbPreferencePage.VALUE_SDB_RESPONSE_TIMEOUT_DEFAULT);
}
/**
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.tizen.common.CommonPlugin;
import org.tizen.common.TizenPlatformConstants;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.common.sdb.command.message.CommandErrorException;
import org.tizen.common.sdb.command.message.CommandErrorType;
import org.tizen.common.sdb.command.receiver.CommandOutputReceiver;
+import org.tizen.common.ui.page.preference.SdbPreferencePage;
import org.tizen.common.ui.view.console.ITizenConsoleManager;
import org.tizen.common.util.HostUtil;
import org.tizen.common.util.StringUtil;
public class SdbCommand {
protected final Logger logger = LoggerFactory.getLogger(getClass());
+ /**
+ * This final int is deprecated and should be removed and use SdbCommand#getDefaultTime() instead.
+ */
+ @Deprecated
public static final int DEFAULT_TIMEOUT = 60000;
private final String SEPARATOR = System.getProperty("line.separator");
private CommandOutputReceiver receiver = null;
private String sdbPath;
private boolean showCommand = false;
+ private int defaultTimeout;
public SdbCommand(IDevice device) {
this(device, null);
this.receiver = receiver;
sdbPath = InstallPathConfig.getSDBPath();
+ this.defaultTimeout = CommonPlugin.getDefault().getPreferenceStore().getInt(SdbPreferencePage.KEY_SDB_RESPONSE_TIMEOUT);
}
public void runCommand(String command) throws Exception {
}
public CommandErrorType runCommand(String command, CommandErrorType messages) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
- return runCommand(command, messages, DEFAULT_TIMEOUT);
+ return runCommand(command, messages, defaultTimeout);
}
public CommandErrorType runCommand(String command, CommandErrorType errorMessages, int timeout) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException{
return commandOutput;
}
+ public int getDefaultTimeout() {
+ return defaultTimeout;
+ }
+
public String[] getResultLineStrings() {
String strs = commandOutput.toString();
if ( StringUtil.isEmpty(strs) ) {
public static String BUTTON_USAGE;
public static String BUTTON_PERFORM;
+ public static String SDB_DESCRIPTION;
+ public static String SDB_RESPONSE_TIMEOUT_GROUP;
+ public static String SDB_RESPONSE_TIMEOUT_LABEL;
+ public static String SDB_RESPONSE_TIMEOUT_CAUTION;
+
static {
NLS.initializeMessages( BUNDLE_NAME, Messages.class );
}
BUTTON_REPORT=I want to contribute this information to improve Tizen IDE
BUTTON_USAGE=Send usage data
BUTTON_PERFORM=Send performance data
+
+SDB_DESCRIPTION=General settings for Tizen SDB:
+SDB_RESPONSE_TIMEOUT_GROUP=Communication
+SDB_RESPONSE_TIMEOUT_LABEL=Connection timeout (ms):
+SDB_RESPONSE_TIMEOUT_CAUTION='0' means waiting forever
\ No newline at end of file
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Kangho Kim <kh5325.kim@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.ui.page.preference;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.tizen.common.CommonPlugin;
+import org.tizen.common.util.SWTUtil;
+
+public class SdbPreferencePage extends FieldEditorPreferencePage implements
+ IWorkbenchPreferencePage
+{
+
+ public static final String id = "org.tizen.common.connection.preferences.sdb";
+ public static final String KEY_SDB_RESPONSE_TIMEOUT = "response_timeout";
+ public static final int VALUE_SDB_RESPONSE_TIMEOUT_DEFAULT = 300000; // 5 min
+
+ public SdbPreferencePage()
+ {
+ setPreferenceStore(CommonPlugin.getDefault().getPreferenceStore());
+ setDescription(Messages.SDB_DESCRIPTION);
+ }
+
+ @Override
+ public void init(IWorkbench workbench)
+ {
+ }
+
+ @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);
+ SWTUtil.createSpacer(composite, 1);
+ createResponseTimeoutPreferences(composite);
+ }
+
+ private void createResponseTimeoutPreferences(Composite parent)
+ {
+ Composite comp = SWTUtil.createGroup(parent,Messages.SDB_RESPONSE_TIMEOUT_GROUP, 1);
+ Composite formatComposite = SWTUtil.createCompositeEx(comp, 2, GridData.FILL_HORIZONTAL);
+ IntegerFieldEditor intField = new IntegerFieldEditor(KEY_SDB_RESPONSE_TIMEOUT, Messages.SDB_RESPONSE_TIMEOUT_LABEL, formatComposite);
+ intField.setValidRange(0, Integer.MAX_VALUE);
+ intField.getTextControl(formatComposite).setToolTipText(Messages.SDB_RESPONSE_TIMEOUT_CAUTION);
+
+ addField(intField);
+ }
+}
+
* - S-Core Co., Ltd
*
*/
-package org.tizen.common.connection.preference;
+package org.tizen.common.ui.page.preference;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.widgets.Composite;