1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

Warnings elimination

This commit is contained in:
Oleg Krasilnikov 2007-02-21 16:53:35 +00:00
parent d816d706b8
commit abc95e03d4
2 changed files with 13 additions and 46 deletions

View file

@ -17,13 +17,12 @@ import java.util.Comparator;
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.cdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacro;
import org.eclipse.cdt.managedbuilder.macros.IBuildMacro;
import org.eclipse.cdt.ui.newui.NewUIMessages;
import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@ -48,7 +47,7 @@ import org.eclipse.swt.widgets.Text;
/*
* the dialog used to create or edit the build macro
*/
public class NewVarDialog extends StatusDialog {
public class NewVarDialog extends Dialog {
// String constants
private static final String PREFIX = "NewBuildMacroDialog"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
@ -64,16 +63,10 @@ public class NewVarDialog extends StatusDialog {
private static final String TYPE_PATH_ANY = TYPE + ".path.any"; //$NON-NLS-1$
private static final String TYPE_PATH_ANY_LIST = TYPE + ".path.any.list"; //$NON-NLS-1$
private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$
private static final String LIST_TITLE = LABEL + ".list.title"; //$NON-NLS-1$
private static final String TITLE_NEW = LABEL + ".title.new"; //$NON-NLS-1$
private static final String TITLE_EDIT = LABEL + ".title.edit"; //$NON-NLS-1$
// private static final String STATUS = LABEL + ".status"; //$NON-NLS-1$
// private static final String STATUS_CANNOT_CTREATE = STATUS + ".cannot.create"; //$NON-NLS-1$
private static final String EMPTY_STRING = new String();
// The title of the dialog.
@ -82,12 +75,6 @@ public class NewVarDialog extends StatusDialog {
private ICdtVariable fEditedMacro;
//the resulting macro. Can be accessed only when the dialog is closed
private ICdtVariable fResultingMacro;
//the string that holds the value is used in the "replace" operation
//private String fReplaceValue = null;
//the string that holds the value is used in the "append/prepend" operations
//private String fAppPrepValue = null;
//specifies whether the fAppPrepValue holds the prepended or appended value
//private boolean fAppPrepPrepend = true;
private boolean fTotalSizeCalculated;
@ -96,7 +83,6 @@ public class NewVarDialog extends StatusDialog {
public boolean isForAllCfgs = false;
// Widgets
// protected Text fMacroNameEdit;
private Composite fContainer;
private Combo fMacroNameEdit;
private Label fMacroValueLabel;
@ -594,7 +580,6 @@ public class NewVarDialog extends StatusDialog {
if(!fTotalSizeCalculated)
return;
handleTypeModified();
validateState();
}
protected Point getInitialSize() {
@ -603,27 +588,4 @@ public class NewVarDialog extends StatusDialog {
updateWidgetState();
return size;
}
/* (non-Javadoc)
* Update the status message and button state based on the variable name
*
*/
private void validateState() {
StatusInfo status= new StatusInfo();
String name = getSelectedVarName();
if(EMPTY_STRING.equals(name)){
// Not an error
status.setError(""); //$NON-NLS-1$
}
//TODO:
//else if(!fMacrosBlock.canCreate(name)){
// status.setError(ManagedBuilderUIMessages.getFormattedString(STATUS_CANNOT_CTREATE, name));
//}
updateStatus(status);
return;
}
}

View file

@ -13,11 +13,11 @@ package org.eclipse.cdt.managedbuilder.ui.newui;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.cdt.internal.ui.dialogs.StatusDialog;
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
import org.eclipse.cdt.managedbuilder.core.IModificationStatus;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
@ -37,7 +37,7 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
public class ToolSelectionDialog extends StatusDialog {
public class ToolSelectionDialog extends Dialog {
private Table t1, t2;
private CLabel errorLabel;
@ -47,11 +47,16 @@ public class ToolSelectionDialog extends StatusDialog {
Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
Color red;
public ToolSelectionDialog(Shell shell ) {
super (shell);
this.setTitle(Messages.getString("ToolSelectionDialog.0")); //$NON-NLS-1$
}
public ToolSelectionDialog(Shell shell ) { super (shell); }
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(Messages.getString("ToolSelectionDialog.0")); //$NON-NLS-1$
}
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());