Commit 3e02f423 authored by ekrisza's avatar ekrisza
Browse files

lets not use literals in conditions if there is a better way

parent 3b11b390
......@@ -12,6 +12,7 @@ import java.io.File;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.titan.designer.preferences.PreferenceConstants;
......@@ -37,7 +38,7 @@ public final class TITANInstallationValidator {
protected void buttonPressed(final int buttonId) {
super.buttonPressed(buttonId);
if (buttonId == 1) {
if (buttonId == Window.CANCEL) {
PreferencesUtil.createPreferenceDialogOn(null,
"org.eclipse.titan.designer.preferences.pages.TITANPreferencePage", null, null).open();
}
......
......@@ -13,6 +13,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.titan.common.logging.ErrorReporter;
......@@ -51,7 +52,7 @@ public final class LicenseValidator {
protected void buttonPressed(final int buttonId) {
super.buttonPressed(buttonId);
if (buttonId == 1) {
if (buttonId == Window.CANCEL) {
PreferencesUtil.createPreferenceDialogOn(null,
"org.eclipse.titan.designer.preferences.pages.TITANPreferencePage", null, null).open();
}
......
......@@ -9,6 +9,7 @@ package org.eclipse.titanium.error;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.PreferencesUtil;
......@@ -48,11 +49,12 @@ public final class ErrorMessage {
public void run() {
final MessageDialog err = new MessageDialog(null, windowTitle, null, message, dialogType,
new String[] { IDialogConstants.OK_LABEL, buttonTitle }, 0) {
@Override
protected void buttonPressed(final int buttonId) {
super.buttonPressed(buttonId);
if (buttonId == 1) {
if (buttonId == Window.CANCEL) {
PreferencesUtil.createPreferenceDialogOn(null, pageName, null,
null).open();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment