use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class PreferenceInitializer method initializeDefaultPreferences.
public void initializeDefaultPreferences() {
IPreferenceStore store = SqlBuilderPlugin.getDefault().getPreferenceStore();
// for PassPolicy Preference
//$NON-NLS-1$
store.setDefault(IConstants.CLIP_EXPORT_SEPARATOR, "|");
//$NON-NLS-1$
store.setDefault(IConstants.DATASETRESULT_DATE_FORMAT, "yyyy-MM-dd");
store.setDefault(IConstants.DATASETRESULT_FORMAT_DATES, true);
store.setDefault(IConstants.SQL_ASSIST, false);
//$NON-NLS-1$
store.setDefault(IConstants.LINE_DELIMITER, "\n");
//$NON-NLS-1$
store.setDefault(IConstants.COMMENT_DELIMITER, "#");
//$NON-NLS-1$
store.setDefault(IConstants.ALTERNATE_DELIMITER, "");
//$NON-NLS-1$
store.setDefault(IConstants.QUERY_DELIMITER, ";");
store.setDefault(IConstants.WARN_RESEULTS, 5000);
}
use of org.eclipse.jface.preference.IPreferenceStore in project tesb-studio-se by Talend.
the class StartRuntimeProgress method run.
@Override
public void run(IProgressMonitor parentMonitor) throws InvocationTargetException, InterruptedException {
SubMonitor subMonitor = SubMonitor.convert(parentMonitor, 10);
//$NON-NLS-1$
subMonitor.setTaskName(RunContainerMessages.getString("StartRuntimeAction.Starting"));
if (!checkRunning()) {
try {
IPreferenceStore store = ESBRunContainerPlugin.getDefault().getPreferenceStore();
Process proc = RuntimeServerController.getInstance().startLocalRuntimeServer(store.getString(RunContainerPreferenceInitializer.P_ESB_RUNTIME_LOCATION));
int i = 0;
//$NON-NLS-1$
String dot = ".";
while (JMXUtil.createJMXconnection() == null && ++i < 11 && !subMonitor.isCanceled() && proc.isAlive()) {
//$NON-NLS-1$
subMonitor.subTask(RunContainerMessages.getString("StartRuntimeAction.Try") + dot);
//$NON-NLS-1$
dot += ".";
subMonitor.worked(1);
Thread.sleep(3000);
}
if (!proc.isAlive()) {
RuntimeServerController.getInstance().stopLocalRuntimeServer();
throw new InterruptedException(RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog8", proc.exitValue()));
}
if (JMXUtil.createJMXconnection() == null) {
throw new InterruptedException(RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog5"));
}
} catch (Exception e) {
ExceptionHandler.process(e);
throw new InvocationTargetException(e, e.getMessage());
}
}
loadConsole();
}
use of org.eclipse.jface.preference.IPreferenceStore in project tesb-studio-se by Talend.
the class RuntimeClientProgress method run.
@Override
public void run(IProgressMonitor parentMonitor) throws InvocationTargetException, InterruptedException {
System.out.println("Running command " + command);
SubMonitor subMonitor = SubMonitor.convert(parentMonitor, 10);
//$NON-NLS-1$
subMonitor.setTaskName("Running script (" + command + ")");
if (checkRunning()) {
subMonitor.subTask("Checking runtime bundles...");
waitForActive(subMonitor);
subMonitor.worked(2);
IPreferenceStore store = ESBRunContainerPlugin.getDefault().getPreferenceStore();
File containerDir = new File(store.getString(RunContainerPreferenceInitializer.P_ESB_RUNTIME_LOCATION));
try {
subMonitor.subTask("Script is running to end...");
executeScript(containerDir);
subMonitor.worked(8);
int size = log.size();
if (!log.get(size - 1).equals("EOF")) {
System.out.println("initlocal.sh logs: " + getLog());
StackTraceElement[] stackTrace = new StackTraceElement[size];
for (int i = 0; i < size; i++) {
stackTrace[i] = new StackTraceElement("RuntimeClientProgress", log.get(i), "Unknown source", i);
}
InterruptedException e = new InterruptedException("Script initlocal.sh run failed");
e.setStackTrace(stackTrace);
throw e;
}
} catch (IOException e) {
throw new InvocationTargetException(e);
}
}
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class SpagicPreferenceInitializer method initializeDefaultPreferences.
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
@Override
public void initializeDefaultPreferences() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(SPAGIC_STATUS, false);
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class SpagicPreferencePage method createFieldEditors.
/*
* @Override protected IPreferenceStore doGetPreferenceStore() { // SpagoPreferenceStore preferenceStore = new
* SpagoPreferenceStore(ProxyRepositoryFactory.getInstance()); // try { // preferenceStore.load(); // } catch
* (PersistenceException e) { // String detailError = e.getMessage(); // new ErrorDialogWidthDetailArea(new Shell(),
* RepositoryPlugin.PLUGIN_ID, Messages // .getString("CommonWizard.persistenceException"), detailError);
* //$NON-NLS-1$ // log.error(Messages.getString("CommonWizard.persistenceException") + "\n" + detailError);
* //$NON-NLS-1$ // //$NON-NLS-2$ // } // return preferenceStore; return
* Activator.getDefault().getPreferenceStore(); }
*/
@Override
protected void createFieldEditors() {
parent = getFieldEditorParent();
spagicCheckButton = new CheckBoxFieldEditor(SpagicPreferenceInitializer.SPAGIC_STATUS, "Enable/Disable Deploy on Spagic", //$NON-NLS-1$
parent);
//$NON-NLS-1$
editor = new SpagicServerEditor(SpagoBiServer.SPAGOBI_SERVER, "Spagic server", parent);
addField(editor);
updateEnableStateFromPreferences();
SelectionListener listener = new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
IPreferenceStore preferenceStore = getPreferenceStore();
preferenceStore.setValue(SpagicPreferenceInitializer.SPAGIC_STATUS, ((Button) e.getSource()).getSelection());
updateEnableStateFromDisplay();
}
};
spagicCheckButton.getButton().addSelectionListener(listener);
// disable the spagic feature
// spagicCheckButton.setEnabled(false, parent);
}
Aggregations