1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-18 13:45:45 +02:00

[cleanup] Fix missing comments

This commit is contained in:
Martin Oberhuber 2008-04-08 18:32:07 +00:00
parent 47a81a0b88
commit 873ff8ec1e
5 changed files with 289 additions and 289 deletions

View file

@ -1,17 +1,18 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* David McKnight (IBM) - [226143] [api][breaking] Make RSE rename/delete dialogs internal
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
@ -27,7 +28,6 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.dialogs.ISystemTypedObject;
import org.eclipse.rse.ui.dialogs.SystemPromptDialog; import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.ISystemMessageLine;
import org.eclipse.rse.ui.view.ISystemPropertyConstants; import org.eclipse.rse.ui.view.ISystemPropertyConstants;
@ -44,18 +44,18 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableColumn;
/** /**
* Dialog for confirming resource deletion. * Dialog for confirming resource deletion.
* <p> * <p>
* This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonDeleteAction} * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonDeleteAction}
* action. It asks the user to confirm the deletion of the input selection. * action. It asks the user to confirm the deletion of the input selection.
* <p>If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter} or * <p>If the input objects do not adapt to {@link org.eclipse.rse.ui.view.ISystemViewElementAdapter} or
* {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, then they should implement the * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, then they should implement the
* interface {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject} so that their type can be * interface {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject} so that their type can be
* displayed in this delete confirmation dialog. * displayed in this delete confirmation dialog.
* *
* @see org.eclipse.rse.internal.ui.actions.SystemCommonDeleteAction * @see org.eclipse.rse.internal.ui.actions.SystemCommonDeleteAction
*/ */
public class SystemDeleteDialog extends SystemPromptDialog public class SystemDeleteDialog extends SystemPromptDialog
implements ISelectionChangedListener implements ISelectionChangedListener
{ {
private String warningMessage, warningTip; private String warningMessage, warningTip;
@ -63,38 +63,38 @@ public class SystemDeleteDialog extends SystemPromptDialog
private SystemDeleteTableProvider sdtp; private SystemDeleteTableProvider sdtp;
//private Label prompt; //private Label prompt;
private Table table; private Table table;
private TableViewer tableViewer; private TableViewer tableViewer;
private GridData tableData; private GridData tableData;
// column headers // column headers
private String columnHeaders[] = { private String columnHeaders[] = {
"", //$NON-NLS-1$ "", //$NON-NLS-1$
SystemResources.RESID_DELETE_COLHDG_OLDNAME, SystemResources.RESID_DELETE_COLHDG_OLDNAME,
SystemResources.RESID_DELETE_COLHDG_TYPE SystemResources.RESID_DELETE_COLHDG_TYPE
}; };
// column layout // column layout
private ColumnLayoutData columnLayouts[] = private ColumnLayoutData columnLayouts[] =
{ {
new ColumnPixelData(19, false), new ColumnPixelData(19, false),
new ColumnWeightData(150,150,true), new ColumnWeightData(150,150,true),
new ColumnWeightData(120,120,true) new ColumnWeightData(120,120,true)
}; };
// give each column a property value to identify it // give each column a property value to identify it
private static String[] tableColumnProperties = private static String[] tableColumnProperties =
{ {
ISystemPropertyConstants.P_OK, ISystemPropertyConstants.P_OK,
IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_TEXT,
ISystemPropertyConstants.P_TYPE, ISystemPropertyConstants.P_TYPE,
}; };
/** /**
* Constructor for SystemUpdateConnectionDialog * Constructor for SystemUpdateConnectionDialog
*/ */
public SystemDeleteDialog(Shell shell) public SystemDeleteDialog(Shell shell)
{ {
super(shell, SystemResources.RESID_DELETE_TITLE); super(shell, SystemResources.RESID_DELETE_TITLE);
super.setOkButtonLabel(SystemResources.RESID_DELETE_BUTTON); super.setOkButtonLabel(SystemResources.RESID_DELETE_BUTTON);
setHelp(RSEUIPlugin.HELPPREFIX+"ddlt0000"); //$NON-NLS-1$ setHelp(RSEUIPlugin.HELPPREFIX+"ddlt0000"); //$NON-NLS-1$
} }
@ -107,29 +107,29 @@ public class SystemDeleteDialog extends SystemPromptDialog
/*ISystemMessageLine msgLine =*/ super.createMessageLine(c); /*ISystemMessageLine msgLine =*/ super.createMessageLine(c);
return fMessageLine; return fMessageLine;
} }
/** /**
* Specify a warning message to show at the top of the dialog * Specify a warning message to show at the top of the dialog
*/ */
public void setWarningMessage(String msg, String tip) public void setWarningMessage(String msg, String tip)
{ {
this.warningMessage = msg; this.warningMessage = msg;
this.warningTip = tip; this.warningTip = tip;
} }
/** /**
* Specify the text to show for the label prompt. The default is * Specify the text to show for the label prompt. The default is
* "Delete selected resources?" * "Delete selected resources?"
*/ */
public void setPromptLabel(String text) public void setPromptLabel(String text)
{ {
this.promptLabel = text; this.promptLabel = text;
} }
/** /**
* @see SystemPromptDialog#getInitialFocusControl() * @see SystemPromptDialog#getInitialFocusControl()
*/ */
protected Control getInitialFocusControl() protected Control getInitialFocusControl()
{ {
return tableViewer.getControl(); return tableViewer.getControl();
} }
@ -137,19 +137,19 @@ public class SystemDeleteDialog extends SystemPromptDialog
/** /**
* @see SystemPromptDialog#createInner(Composite) * @see SystemPromptDialog#createInner(Composite)
*/ */
protected Control createInner(Composite parent) protected Control createInner(Composite parent)
{ {
// Inner composite // Inner composite
int nbrColumns = 2; int nbrColumns = 2;
Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns); Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
// PROMPT // PROMPT
if (promptLabel == null) { if (promptLabel == null) {
Object input = getInputObject(); Object input = getInputObject();
if (input instanceof IStructuredSelection) { if (input instanceof IStructuredSelection) {
int size = ((IStructuredSelection)input).size(); int size = ((IStructuredSelection)input).size();
if (size > 1) { if (size > 1) {
/*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns); /*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns);
} }
@ -159,7 +159,7 @@ public class SystemDeleteDialog extends SystemPromptDialog
} }
// should never get here // should never get here
else { else {
/*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns); /*prompt =*/ SystemWidgetHelpers.createLabel(composite, SystemResources.RESID_DELETE_PROMPT, nbrColumns);
} }
} }
else { else {
@ -174,7 +174,7 @@ public class SystemDeleteDialog extends SystemPromptDialog
// create image // create image
Image image = getShell().getDisplay().getSystemImage(SWT.ICON_WARNING); Image image = getShell().getDisplay().getSystemImage(SWT.ICON_WARNING);
Label imageLabel = null; Label imageLabel = null;
if (image != null) if (image != null)
{ {
imageLabel = new Label(composite, 0); imageLabel = new Label(composite, 0);
image.setBackground(imageLabel.getBackground()); image.setBackground(imageLabel.getBackground());
@ -194,34 +194,34 @@ public class SystemDeleteDialog extends SystemPromptDialog
// filler line // filler line
SystemWidgetHelpers.createLabel(composite, "", nbrColumns); //$NON-NLS-1$ SystemWidgetHelpers.createLabel(composite, "", nbrColumns); //$NON-NLS-1$
} }
// TABLE // TABLE
tableViewer = createTableViewer(composite, nbrColumns); tableViewer = createTableViewer(composite, nbrColumns);
createColumns(); createColumns();
tableViewer.setColumnProperties(tableColumnProperties); tableViewer.setColumnProperties(tableColumnProperties);
sdtp = new SystemDeleteTableProvider(); sdtp = new SystemDeleteTableProvider();
int width = tableData.widthHint; int width = tableData.widthHint;
int nbrRows = Math.min(getRows().length,8); int nbrRows = Math.min(getRows().length,8);
int rowHeight = table.getItemHeight() + table.getGridLineWidth(); int rowHeight = table.getItemHeight() + table.getGridLineWidth();
int sbHeight = table.getHorizontalBar().getSize().y; int sbHeight = table.getHorizontalBar().getSize().y;
int height = (nbrRows * rowHeight) + sbHeight; int height = (nbrRows * rowHeight) + sbHeight;
tableData.heightHint = height; tableData.heightHint = height;
table.setLayoutData(tableData); table.setLayoutData(tableData);
table.setSize(width, height); table.setSize(width, height);
tableViewer.setLabelProvider(sdtp); tableViewer.setLabelProvider(sdtp);
tableViewer.setContentProvider(sdtp); tableViewer.setContentProvider(sdtp);
Object input = getInputObject(); Object input = getInputObject();
tableViewer.setInput(input); tableViewer.setInput(input);
return composite; return composite;
} }
private TableViewer createTableViewer(Composite parent, int nbrColumns) private TableViewer createTableViewer(Composite parent, int nbrColumns)
{ {
table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.HIDE_SELECTION); table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.HIDE_SELECTION);
table.setLinesVisible(true); table.setLinesVisible(true);
@ -229,33 +229,33 @@ public class SystemDeleteDialog extends SystemPromptDialog
tableData = new GridData(); tableData = new GridData();
tableData.horizontalAlignment = GridData.FILL; tableData.horizontalAlignment = GridData.FILL;
tableData.grabExcessHorizontalSpace = true; tableData.grabExcessHorizontalSpace = true;
tableData.widthHint = 350; tableData.widthHint = 350;
tableData.heightHint = 30; tableData.heightHint = 30;
tableData.verticalAlignment = GridData.CENTER; tableData.verticalAlignment = GridData.CENTER;
tableData.grabExcessVerticalSpace = true; tableData.grabExcessVerticalSpace = true;
tableData.horizontalSpan = nbrColumns; tableData.horizontalSpan = nbrColumns;
table.setLayoutData(tableData); table.setLayoutData(tableData);
return tableViewer; return tableViewer;
} }
private void createColumns() private void createColumns()
{ {
TableLayout layout = new TableLayout(); TableLayout layout = new TableLayout();
table.setLayout(layout); table.setLayout(layout);
table.setHeaderVisible(true); table.setHeaderVisible(true);
for (int i = 0; i < columnHeaders.length; i++) for (int i = 0; i < columnHeaders.length; i++)
{ {
layout.addColumnData(columnLayouts[i]); layout.addColumnData(columnLayouts[i]);
TableColumn tc = new TableColumn(table, SWT.NONE,i); TableColumn tc = new TableColumn(table, SWT.NONE,i);
tc.setResizable(columnLayouts[i].resizable); tc.setResizable(columnLayouts[i].resizable);
tc.setText(columnHeaders[i]); tc.setText(columnHeaders[i]);
} }
} }
public void selectionChanged(SelectionChangedEvent event) public void selectionChanged(SelectionChangedEvent event)
{ {
} }
/** /**
* Override of parent. Must pass selected object onto the form for initializing fields. * Override of parent. Must pass selected object onto the form for initializing fields.
* Called by SystemDialogAction's default run() method after dialog instantiated. * Called by SystemDialogAction's default run() method after dialog instantiated.
@ -266,15 +266,15 @@ public class SystemDeleteDialog extends SystemPromptDialog
} }
/** /**
* Called when user presses OK button. * Called when user presses OK button.
* Return true to close dialog. * Return true to close dialog.
* Return false to not close dialog. * Return false to not close dialog.
*/ */
protected boolean processOK() protected boolean processOK()
{ {
return true; return true;
} }
/** /**
* Returns the rows of deletable items. * Returns the rows of deletable items.
*/ */
@ -282,14 +282,14 @@ public class SystemDeleteDialog extends SystemPromptDialog
{ {
return (SystemDeleteTableRow[])sdtp.getElements(getInputObject()); return (SystemDeleteTableRow[])sdtp.getElements(getInputObject());
} }
/** /**
* Returns the implementation of ISystemViewElement for the given * Returns the implementation of ISystemViewElement for the given
* object. Returns null if the adapter is not defined or the * object. Returns null if the adapter is not defined or the
* object is not adaptable. * object is not adaptable.
*/ */
protected ISystemViewElementAdapter getViewAdapter(Object o) protected ISystemViewElementAdapter getViewAdapter(Object o)
{ {
return SystemAdapterHelpers.getViewAdapter(o); return SystemAdapterHelpers.getViewAdapter(o);
} }
} }

View file

@ -1,17 +1,17 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2008 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David McKnight (IBM) - [226143] [api][breaking] Make RSE rename/delete dialogs internal
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
@ -33,45 +33,45 @@ import org.eclipse.swt.graphics.Image;
*/ */
public class SystemDeleteTableProvider implements ITableLabelProvider, IStructuredContentProvider public class SystemDeleteTableProvider implements ITableLabelProvider, IStructuredContentProvider
{ {
static final int COLUMN_IMAGE = 0; static final int COLUMN_IMAGE = 0;
static final int COLUMN_NAME = 1; static final int COLUMN_NAME = 1;
static final int COLUMN_TYPE = 2; static final int COLUMN_TYPE = 2;
protected Map imageTable = new Hashtable(20); protected Map imageTable = new Hashtable(20);
protected Object[] children = null; protected Object[] children = null;
/** /**
* Constructor for SystemDeleteTableProvider * Constructor for SystemDeleteTableProvider
*/ */
public SystemDeleteTableProvider() public SystemDeleteTableProvider()
{ {
super(); super();
} }
private SystemDeleteTableRow getTableRow(Object element) private SystemDeleteTableRow getTableRow(Object element)
{ {
return (SystemDeleteTableRow)element; return (SystemDeleteTableRow)element;
} }
private Image getImageFromDescriptor(ImageDescriptor descriptor) private Image getImageFromDescriptor(ImageDescriptor descriptor)
{ {
if (descriptor == null) if (descriptor == null)
return null; return null;
//obtain the cached image corresponding to the descriptor //obtain the cached image corresponding to the descriptor
Image image = (Image) imageTable.get(descriptor); Image image = (Image) imageTable.get(descriptor);
if (image == null) if (image == null)
{ {
image = descriptor.createImage(); image = descriptor.createImage();
imageTable.put(descriptor, image); imageTable.put(descriptor, image);
} }
//System.out.println("...image = " + image); //System.out.println("...image = " + image);
return image; return image;
} }
/** /**
* @see ITableLabelProvider#getColumnImage(java.lang.Object, int) * @see ITableLabelProvider#getColumnImage(java.lang.Object, int)
*/ */
public Image getColumnImage(Object element, int column) public Image getColumnImage(Object element, int column)
{ {
if (column == COLUMN_IMAGE) if (column == COLUMN_IMAGE)
return getImageFromDescriptor(getTableRow(element).getImageDescriptor()); return getImageFromDescriptor(getTableRow(element).getImageDescriptor());
@ -82,28 +82,28 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see ITableLabelProvider#getColumnText(java.lang.Object, int) * @see ITableLabelProvider#getColumnText(java.lang.Object, int)
*/ */
public String getColumnText(Object element, int column) public String getColumnText(Object element, int column)
{ {
String text = ""; //$NON-NLS-1$ String text = ""; //$NON-NLS-1$
if (column == COLUMN_NAME) if (column == COLUMN_NAME)
text = getTableRow(element).getName(); text = getTableRow(element).getName();
else if (column == COLUMN_TYPE) else if (column == COLUMN_TYPE)
text = getTableRow(element).getType(); text = getTableRow(element).getType();
//System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element)); //System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element));
return text; return text;
} }
/** /**
* @see IBaseLabelProvider#addListener(ILabelProviderListener) * @see IBaseLabelProvider#addListener(ILabelProviderListener)
*/ */
public void addListener(ILabelProviderListener listener) public void addListener(ILabelProviderListener listener)
{ {
} }
/** /**
* @see IBaseLabelProvider#dispose() * @see IBaseLabelProvider#dispose()
*/ */
public void dispose() public void dispose()
{ {
// The following we got from WorkbenchLabelProvider // The following we got from WorkbenchLabelProvider
if (imageTable != null) if (imageTable != null)
@ -111,11 +111,11 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
Collection imageValues = imageTable.values(); Collection imageValues = imageTable.values();
if (imageValues!=null) if (imageValues!=null)
{ {
Iterator images = imageValues.iterator(); Iterator images = imageValues.iterator();
if (images!=null) if (images!=null)
while (images.hasNext()) while (images.hasNext())
((Image)images.next()).dispose(); ((Image)images.next()).dispose();
imageTable = null; imageTable = null;
} }
} }
} }
@ -123,7 +123,7 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) * @see IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
*/ */
public boolean isLabelProperty(Object element, String property) public boolean isLabelProperty(Object element, String property)
{ {
return true; return true;
} }
@ -131,10 +131,10 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) * @see IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/ */
public void removeListener(ILabelProviderListener listener) public void removeListener(ILabelProviderListener listener)
{ {
} }
/** /**
* Return rows. Input must be an IStructuredSelection. * Return rows. Input must be an IStructuredSelection.
*/ */
@ -148,13 +148,13 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
int idx = 0; int idx = 0;
while (i.hasNext()) while (i.hasNext())
{ {
children[idx] = new SystemDeleteTableRow(i.next(), idx); children[idx] = new SystemDeleteTableRow(i.next(), idx);
idx++; idx++;
} }
} }
return children; return children;
} }
/** /**
* Return the 0-based row number of the given element. * Return the 0-based row number of the given element.
*/ */
@ -162,9 +162,9 @@ public class SystemDeleteTableProvider implements ITableLabelProvider, IStructur
{ {
return row.getRowNumber(); return row.getRowNumber();
} }
/** /**
* *
*/ */
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
{ {

View file

@ -7,12 +7,13 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David McKnight (IBM) - [226143] [api][breaking] Make RSE rename/delete dialogs internal
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
@ -42,7 +43,6 @@ import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.dialogs.ISystemTypedObject;
import org.eclipse.rse.ui.dialogs.SystemPromptDialog; import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.ISystemMessageLine;
import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ISystemValidator;
@ -71,71 +71,71 @@ import org.eclipse.swt.widgets.Text;
* Dialog for renaming multiple resources. * Dialog for renaming multiple resources.
* <p> * <p>
* This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction} * This is a re-usable dialog that you can use directly, or via the {@link org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction}
* action. * action.
* <p> * <p>
* To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed. * To use this dialog, you must call setInputObject with a StructuredSelection of the objects to be renamed.
* If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or * If those objects adapt to {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter} or
* {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking. * {@link org.eclipse.rse.ui.view.ISystemRemoteElementAdapter}, the dialog will offer built-in error checking.
* <p> * <p>
* If the input objects do not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you * If the input objects do not adapt to org.eclipse.rse.ui.view.ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you
* should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to * should call {@link #setNameValidator(org.eclipse.rse.ui.validators.ISystemValidator)} to
* specify a validator that is called to verify the typed new name is valid. Further, to show the type value * specify a validator that is called to verify the typed new name is valid. Further, to show the type value
* of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}. * of the input objects, they should implement {@link org.eclipse.rse.ui.dialogs.ISystemTypedObject}.
* <p> * <p>
* This dialog does not do the actual renames. Rather, it will return an array of the user-typed new names. These * This dialog does not do the actual renames. Rather, it will return an array of the user-typed new names. These
* are queriable via {@link #getNewNames()}, after testing that {@link #wasCancelled()} is false. The array entries * are queriable via {@link #getNewNames()}, after testing that {@link #wasCancelled()} is false. The array entries
* will match the input order. * will match the input order.
* *
* @see org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction * @see org.eclipse.rse.internal.ui.actions.SystemCommonRenameAction
*/ */
public class SystemRenameDialog extends SystemPromptDialog public class SystemRenameDialog extends SystemPromptDialog
implements implements
ISelectionChangedListener, ISelectionChangedListener,
TraverseListener, TraverseListener,
ICellEditorListener, Runnable, FocusListener ICellEditorListener, Runnable, FocusListener
{ {
private SystemMessage errorMessage; private SystemMessage errorMessage;
private TextCellEditor cellEditor; private TextCellEditor cellEditor;
private int currRow = 0; private int currRow = 0;
private GridData tableData = null; private GridData tableData = null;
private boolean ignoreSelection = false; private boolean ignoreSelection = false;
private Hashtable uniqueNameValidatorPerParent = new Hashtable(); private Hashtable uniqueNameValidatorPerParent = new Hashtable();
private String verbiage; private String verbiage;
private SystemRenameTableProvider srtp; private SystemRenameTableProvider srtp;
private Table table; private Table table;
private TableViewer tableViewer; private TableViewer tableViewer;
private static final int COLUMN_NEWNAME = SystemRenameTableProvider.COLUMN_NEWNAME; private static final int COLUMN_NEWNAME = SystemRenameTableProvider.COLUMN_NEWNAME;
private String columnHeaders[] = { private String columnHeaders[] = {
"",SystemResources.RESID_RENAME_COLHDG_OLDNAME, //$NON-NLS-1$ "",SystemResources.RESID_RENAME_COLHDG_OLDNAME, //$NON-NLS-1$
SystemResources.RESID_RENAME_COLHDG_NEWNAME, SystemResources.RESID_RENAME_COLHDG_NEWNAME,
SystemResources.RESID_RENAME_COLHDG_TYPE SystemResources.RESID_RENAME_COLHDG_TYPE
}; };
private ColumnLayoutData columnLayouts[] = private ColumnLayoutData columnLayouts[] =
{ {
new ColumnPixelData(19, false), new ColumnPixelData(19, false),
new ColumnWeightData(125,125,true), new ColumnWeightData(125,125,true),
new ColumnWeightData(150,150,true), new ColumnWeightData(150,150,true),
new ColumnWeightData(120,120,true) new ColumnWeightData(120,120,true)
}; };
// give each column a property value to identify it // give each column a property value to identify it
private static String[] tableColumnProperties = private static String[] tableColumnProperties =
{ {
ISystemPropertyConstants.P_ERROR, ISystemPropertyConstants.P_ERROR,
IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_TEXT,
ISystemPropertyConstants.P_NEWNAME, ISystemPropertyConstants.P_NEWNAME,
ISystemPropertyConstants.P_TYPE, ISystemPropertyConstants.P_TYPE,
}; };
// inner class to support cell editing // inner class to support cell editing
private ICellModifier cellModifier = new ICellModifier() private ICellModifier cellModifier = new ICellModifier()
{ {
public Object getValue(Object element, String property) public Object getValue(Object element, String property)
{ {
SystemRenameTableRow row = (SystemRenameTableRow)element; SystemRenameTableRow row = (SystemRenameTableRow)element;
String value = ""; //$NON-NLS-1$ String value = ""; //$NON-NLS-1$
if (property.equals(ISystemPropertyConstants.P_TEXT)) if (property.equals(IBasicPropertyConstants.P_TEXT))
value = row.getName(); value = row.getName();
else else
value = row.getNewName(); value = row.getNewName();
@ -143,12 +143,12 @@ public class SystemRenameDialog extends SystemPromptDialog
return value; return value;
} }
public boolean canModify(Object element, String property) public boolean canModify(Object element, String property)
{ {
boolean modifiable = property.equals(ISystemPropertyConstants.P_NEWNAME); boolean modifiable = property.equals(ISystemPropertyConstants.P_NEWNAME);
if ((cellEditor != null) && (cellEditor.getControl() != null)) if ((cellEditor != null) && (cellEditor.getControl() != null))
{ {
SystemRenameTableRow row = (SystemRenameTableRow)element; SystemRenameTableRow row = (SystemRenameTableRow)element;
int limit = row.getNameLengthLimit(); int limit = row.getNameLengthLimit();
if (limit == -1) if (limit == -1)
limit = 1000; limit = 1000;
@ -159,10 +159,10 @@ public class SystemRenameDialog extends SystemPromptDialog
/** /**
* Modifies a marker as a result of a successfully completed direct editing. * Modifies a marker as a result of a successfully completed direct editing.
*/ */
public void modify(Object element, String property, Object value) public void modify(Object element, String property, Object value)
{ {
SystemRenameTableRow row = (SystemRenameTableRow)(((TableItem)element).getData()); SystemRenameTableRow row = (SystemRenameTableRow)(((TableItem)element).getData());
//System.out.println("inside modify: " + row+"; "+property+", "+value); //System.out.println("inside modify: " + row+"; "+property+", "+value);
if (property.equals(ISystemPropertyConstants.P_NEWNAME)) if (property.equals(ISystemPropertyConstants.P_NEWNAME))
{ {
row.setNewName((String)value); row.setNewName((String)value);
@ -170,21 +170,21 @@ public class SystemRenameDialog extends SystemPromptDialog
} }
} }
}; };
/** /**
* Constructor for SystemRenameDialog * Constructor for SystemRenameDialog
*/ */
public SystemRenameDialog(Shell shell) public SystemRenameDialog(Shell shell)
{ {
this(shell, SystemResources.RESID_RENAME_TITLE); this(shell, SystemResources.RESID_RENAME_TITLE);
} }
/** /**
* Constructor when you have your own title * Constructor when you have your own title
*/ */
public SystemRenameDialog(Shell shell, String title) public SystemRenameDialog(Shell shell, String title)
{ {
super(shell, title); super(shell, title);
//pack(); //pack();
setHelp(RSEUIPlugin.HELPPREFIX+"drnm0000"); //$NON-NLS-1$ setHelp(RSEUIPlugin.HELPPREFIX+"drnm0000"); //$NON-NLS-1$
@ -195,7 +195,7 @@ public class SystemRenameDialog extends SystemPromptDialog
public void setVerbiage(String verbiage) public void setVerbiage(String verbiage)
{ {
this.verbiage = verbiage; this.verbiage = verbiage;
} }
/** /**
* Set the validator for the new name,as supplied by the adaptor for name checking. * Set the validator for the new name,as supplied by the adaptor for name checking.
* Overrides the default which is to query it from the object's adapter. * Overrides the default which is to query it from the object's adapter.
@ -216,7 +216,7 @@ public class SystemRenameDialog extends SystemPromptDialog
/** /**
* @see SystemPromptDialog#getInitialFocusControl() * @see SystemPromptDialog#getInitialFocusControl()
*/ */
protected Control getInitialFocusControl() protected Control getInitialFocusControl()
{ {
SystemRenameTableRow[] rows = getRows(); SystemRenameTableRow[] rows = getRows();
tableViewer.setSelection(new StructuredSelection(rows[0]),true); tableViewer.setSelection(new StructuredSelection(rows[0]),true);
@ -227,47 +227,47 @@ public class SystemRenameDialog extends SystemPromptDialog
/** /**
* @see SystemPromptDialog#createInner(Composite) * @see SystemPromptDialog#createInner(Composite)
*/ */
protected Control createInner(Composite parent) protected Control createInner(Composite parent)
{ {
// Inner composite // Inner composite
int nbrColumns = 1; int nbrColumns = 1;
Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns); Composite composite = SystemWidgetHelpers.createComposite(parent, nbrColumns);
if (verbiage != null) if (verbiage != null)
SystemWidgetHelpers.createVerbiage(composite, verbiage, nbrColumns, false, 200); SystemWidgetHelpers.createVerbiage(composite, verbiage, nbrColumns, false, 200);
else else
SystemWidgetHelpers.createVerbiage(composite, SystemResources.RESID_RENAME_VERBIAGE, nbrColumns, false, 200); SystemWidgetHelpers.createVerbiage(composite, SystemResources.RESID_RENAME_VERBIAGE, nbrColumns, false, 200);
table = createTable(composite); table = createTable(composite);
tableViewer = new TableViewer(table); tableViewer = new TableViewer(table);
createColumns(); createColumns();
tableViewer.setColumnProperties(tableColumnProperties); tableViewer.setColumnProperties(tableColumnProperties);
tableViewer.setCellModifier(cellModifier); tableViewer.setCellModifier(cellModifier);
CellEditor editors[] = new CellEditor[columnHeaders.length]; CellEditor editors[] = new CellEditor[columnHeaders.length];
cellEditor = new TextCellEditor(table); cellEditor = new TextCellEditor(table);
cellEditor.addListener(this); cellEditor.addListener(this);
editors[COLUMN_NEWNAME] = cellEditor; editors[COLUMN_NEWNAME] = cellEditor;
tableViewer.setCellEditors(editors); tableViewer.setCellEditors(editors);
cellEditor.getControl().addTraverseListener(this); cellEditor.getControl().addTraverseListener(this);
//System.out.println("CELL EDITOR CONTROL: " + cellEditor.getControl()); //System.out.println("CELL EDITOR CONTROL: " + cellEditor.getControl());
srtp = new SystemRenameTableProvider(); srtp = new SystemRenameTableProvider();
int width = tableData.widthHint; int width = tableData.widthHint;
int nbrRows = Math.min(getRows().length,8); int nbrRows = Math.min(getRows().length,8);
int rowHeight = table.getItemHeight() + table.getGridLineWidth(); int rowHeight = table.getItemHeight() + table.getGridLineWidth();
int sbHeight = table.getHorizontalBar().getSize().y; int sbHeight = table.getHorizontalBar().getSize().y;
int height = (nbrRows * rowHeight) + sbHeight; int height = (nbrRows * rowHeight) + sbHeight;
//System.out.println("#rows = "+nbrRows+", sbHeight = " + sbHeight+", totalHeight="+height); //System.out.println("#rows = "+nbrRows+", sbHeight = " + sbHeight+", totalHeight="+height);
tableData.heightHint = height; tableData.heightHint = height;
table.setLayoutData(tableData); table.setLayoutData(tableData);
table.setSize(width, height); table.setSize(width, height);
tableViewer.setLabelProvider(srtp); tableViewer.setLabelProvider(srtp);
tableViewer.setContentProvider(srtp); tableViewer.setContentProvider(srtp);
//System.out.println("Input Object: "+getInputObject()); //System.out.println("Input Object: "+getInputObject());
tableViewer.setInput(getInputObject()); tableViewer.setInput(getInputObject());
tableViewer.addSelectionChangedListener(this); tableViewer.addSelectionChangedListener(this);
tableViewer.getTable().addFocusListener(this); tableViewer.getTable().addFocusListener(this);
// test if we need a unique name validator // test if we need a unique name validator
Shell shell = getShell(); Shell shell = getShell();
@ -276,52 +276,52 @@ public class SystemRenameDialog extends SystemPromptDialog
display.asyncExec(this); display.asyncExec(this);
else else
run(); run();
return composite; return composite;
} }
private Table createTable(Composite parent)
private Table createTable(Composite parent)
{ {
//table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER); //table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER);
table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION); table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
table.setLinesVisible(true); table.setLinesVisible(true);
tableData = new GridData(); tableData = new GridData();
tableData.horizontalAlignment = GridData.FILL; tableData.horizontalAlignment = GridData.FILL;
tableData.grabExcessHorizontalSpace = true; tableData.grabExcessHorizontalSpace = true;
tableData.widthHint = 450; tableData.widthHint = 450;
tableData.heightHint= 30; tableData.heightHint= 30;
tableData.verticalAlignment = GridData.CENTER; tableData.verticalAlignment = GridData.CENTER;
tableData.grabExcessVerticalSpace = true; tableData.grabExcessVerticalSpace = true;
table.setLayoutData(tableData); table.setLayoutData(tableData);
//table.addTraverseListener(this); //table.addTraverseListener(this);
//getShell().addTraverseListener(this); //getShell().addTraverseListener(this);
return table; return table;
} }
private void createColumns() private void createColumns()
{ {
TableLayout layout = new TableLayout(); TableLayout layout = new TableLayout();
table.setLayout(layout); table.setLayout(layout);
table.setHeaderVisible(true); table.setHeaderVisible(true);
for (int i = 0; i < columnHeaders.length; i++) for (int i = 0; i < columnHeaders.length; i++)
{ {
layout.addColumnData(columnLayouts[i]); layout.addColumnData(columnLayouts[i]);
TableColumn tc = new TableColumn(table, SWT.NONE,i); TableColumn tc = new TableColumn(table, SWT.NONE,i);
tc.setResizable(columnLayouts[i].resizable); tc.setResizable(columnLayouts[i].resizable);
tc.setText(columnHeaders[i]); tc.setText(columnHeaders[i]);
//tc.addSelectionListener(headerListener); //tc.addSelectionListener(headerListener);
} }
} }
public void selectionChanged(SelectionChangedEvent event) public void selectionChanged(SelectionChangedEvent event)
{ {
//System.out.println("Selection changed. ignoreSelection? "+ignoreSelection); //System.out.println("Selection changed. ignoreSelection? "+ignoreSelection);
if (ignoreSelection) if (ignoreSelection)
return; return;
IStructuredSelection selection = (IStructuredSelection) event.getSelection(); IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection.isEmpty()) if (selection.isEmpty())
{ {
currRow = -1; currRow = -1;
return; return;
@ -330,8 +330,8 @@ public class SystemRenameDialog extends SystemPromptDialog
int rowIdx = srtp.getRowNumber(selectedRow); int rowIdx = srtp.getRowNumber(selectedRow);
if (rowIdx == currRow) if (rowIdx == currRow)
return; return;
currRow = rowIdx; currRow = rowIdx;
tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME); tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME);
} }
/** /**
* Override of parent. Must pass selected object onto the form for initializing fields. * Override of parent. Must pass selected object onto the form for initializing fields.
@ -344,12 +344,12 @@ public class SystemRenameDialog extends SystemPromptDialog
} }
/** /**
* Called when user presses OK button. * Called when user presses OK button.
* This does not do the actual renames, but rather updates the new name array. * This does not do the actual renames, but rather updates the new name array.
* You need to query this via {@link #getNewNames()}, after ensuring the dialog was not * You need to query this via {@link #getNewNames()}, after ensuring the dialog was not
* cancelled by calling {@link #wasCancelled()}. * cancelled by calling {@link #wasCancelled()}.
*/ */
protected boolean processOK() protected boolean processOK()
{ {
// the following is for defect 41565 where the changed name is not used when enter pressed after typing // the following is for defect 41565 where the changed name is not used when enter pressed after typing
if ((currRow >=0) && (currRow <= (getRows().length - 1))) if ((currRow >=0) && (currRow <= (getRows().length - 1)))
@ -360,31 +360,31 @@ public class SystemRenameDialog extends SystemPromptDialog
} }
//else //else
// System.out.println("currRow = "+currRow); // System.out.println("currRow = "+currRow);
boolean closeDialog = verify(); boolean closeDialog = verify();
if (closeDialog) if (closeDialog)
{ {
} }
return closeDialog; return closeDialog;
} }
/** /**
* Verifies all input. * Verifies all input.
* @return true if there are no errors in the user input * @return true if there are no errors in the user input
*/ */
public boolean verify() public boolean verify()
{ {
SystemMessage errMsg = null; SystemMessage errMsg = null;
SystemMessage firstErrMsg = null; SystemMessage firstErrMsg = null;
SystemRenameTableRow firstErrRow = null; SystemRenameTableRow firstErrRow = null;
clearErrorMessage(); clearErrorMessage();
SystemRenameTableRow[] rows = getRows(); SystemRenameTableRow[] rows = getRows();
Vector newNames = new Vector(); Vector newNames = new Vector();
// first, clear pending errors... // first, clear pending errors...
for (int idx=0; (idx<rows.length); idx++) for (int idx=0; (idx<rows.length); idx++)
rows[idx].setErrorMessage(null); rows[idx].setErrorMessage(null);
// check 1: all entries have a new name, and the new name is unique for this list. // check 1: all entries have a new name, and the new name is unique for this list.
for (int idx=0; (firstErrMsg==null) && (idx<rows.length); idx++) for (int idx=0; (firstErrMsg==null) && (idx<rows.length); idx++)
//for (int idx=0; (idx<rows.length); idx++) //for (int idx=0; (idx<rows.length); idx++)
{ {
errMsg = null; errMsg = null;
String oldName = rows[idx].getName(); String oldName = rows[idx].getName();
@ -415,10 +415,10 @@ public class SystemRenameDialog extends SystemPromptDialog
if (!ok) if (!ok)
errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELED); errMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELED);
} }
} }
if (errMsg == null) if (errMsg == null)
{ {
//newNames.addElement(newName); //newNames.addElement(newName);
newNames.addElement(canonicalNewName); // defect 42145 newNames.addElement(canonicalNewName); // defect 42145
} }
@ -432,13 +432,13 @@ public class SystemRenameDialog extends SystemPromptDialog
if (firstErrMsg != null) if (firstErrMsg != null)
{ {
setErrorMessage(firstErrMsg); setErrorMessage(firstErrMsg);
tableViewer.update(rows,null); tableViewer.update(rows,null);
tableViewer.setSelection(new StructuredSelection(firstErrRow),true); tableViewer.setSelection(new StructuredSelection(firstErrRow),true);
tableViewer.editElement(firstErrRow,COLUMN_NEWNAME); tableViewer.editElement(firstErrRow,COLUMN_NEWNAME);
} }
return (firstErrMsg == null); return (firstErrMsg == null);
} }
/** /**
* This hook method is called whenever the text changes in the input field. * This hook method is called whenever the text changes in the input field.
* The default implementation delegates the request to an <code>ISystemValidator</code> object. * The default implementation delegates the request to an <code>ISystemValidator</code> object.
@ -446,18 +446,18 @@ public class SystemRenameDialog extends SystemPromptDialog
* in the Dialog's message line. * in the Dialog's message line.
* @see #setNameValidator(ISystemValidator) * @see #setNameValidator(ISystemValidator)
*/ */
protected SystemMessage validateNameInput() protected SystemMessage validateNameInput()
{ {
errorMessage= null; errorMessage= null;
if (errorMessage == null) if (errorMessage == null)
clearErrorMessage(); clearErrorMessage();
else else
setErrorMessage(errorMessage); setErrorMessage(errorMessage);
setPageComplete(); setPageComplete();
return errorMessage; return errorMessage;
} }
/** /**
* This method can be called by the dialog or wizard page host, to decide whether to enable * This method can be called by the dialog or wizard page host, to decide whether to enable
* or disable the next, final or ok buttons. It returns true if the minimal information is * or disable the next, final or ok buttons. It returns true if the minimal information is
@ -470,7 +470,7 @@ public class SystemRenameDialog extends SystemPromptDialog
pageComplete = true; pageComplete = true;
return pageComplete; return pageComplete;
} }
/** /**
* Inform caller of page-complete status of this form * Inform caller of page-complete status of this form
*/ */
@ -485,23 +485,23 @@ public class SystemRenameDialog extends SystemPromptDialog
*/ */
public void keyTraversed(TraverseEvent e) public void keyTraversed(TraverseEvent e)
{ {
int detail = e.detail; int detail = e.detail;
//System.out.println("in keyTraversed: " + keycode + ", " + detail + ", " + doit); //System.out.println("in keyTraversed: " + keycode + ", " + detail + ", " + doit);
e.doit = false; e.doit = false;
ignoreSelection = true; ignoreSelection = true;
//System.out.println("...Key pressed. currRow = "+currRow); //System.out.println("...Key pressed. currRow = "+currRow);
// DEFECT 41807 STATED USERS SHOULD BE ALLOWED TO TAB TO THE BUTTONS // DEFECT 41807 STATED USERS SHOULD BE ALLOWED TO TAB TO THE BUTTONS
if (detail == SWT.TRAVERSE_TAB_NEXT) if (detail == SWT.TRAVERSE_TAB_NEXT)
{ {
if (currRow != getRows().length-1) if (currRow != getRows().length-1)
{ {
++currRow; ++currRow;
//System.out.println("...D TAB pressed. currRow = "+currRow); //System.out.println("...D TAB pressed. currRow = "+currRow);
//tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true); //tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true);
tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME); tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME);
} }
else else
{ {
@ -518,9 +518,9 @@ public class SystemRenameDialog extends SystemPromptDialog
--currRow; --currRow;
else else
currRow = 0; currRow = 0;
//System.out.println("...D BACKTAB pressed. currRow = "+currRow); //System.out.println("...D BACKTAB pressed. currRow = "+currRow);
//tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true); //tableViewer.setSelection(new StructuredSelection(getRows()[currRow]),true);
tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME); tableViewer.editElement(getRows()[currRow], COLUMN_NEWNAME);
} }
else else
{ {
@ -530,18 +530,18 @@ public class SystemRenameDialog extends SystemPromptDialog
} }
} }
else else
e.doit = true; e.doit = true;
ignoreSelection = false; ignoreSelection = false;
} }
/** /**
* Returns the rows of rename items. * Returns the rows of rename items.
*/ */
public SystemRenameTableRow[] getRows() public SystemRenameTableRow[] getRows()
{ {
return (SystemRenameTableRow[])srtp.getElements(getInputObject()); return (SystemRenameTableRow[])srtp.getElements(getInputObject());
} }
/** /**
* Returns an array of the new names. * Returns an array of the new names.
*/ */
@ -552,8 +552,8 @@ public class SystemRenameDialog extends SystemPromptDialog
for (int idx=0; idx<rows.length; idx++) for (int idx=0; idx<rows.length; idx++)
names[idx] = rows[idx].getNewName(); names[idx] = rows[idx].getNewName();
return names; return names;
} }
// CELL EDITOR METHODS // CELL EDITOR METHODS
public void applyEditorValue() public void applyEditorValue()
{ {
@ -561,11 +561,11 @@ public class SystemRenameDialog extends SystemPromptDialog
} }
public void cancelEditor() public void cancelEditor()
{ {
//System.out.println("CELLEDITOR: INSIDE CANCELEDITOR"); //System.out.println("CELLEDITOR: INSIDE CANCELEDITOR");
} }
public void editorValueChanged(boolean oldValidState,boolean newValidState) public void editorValueChanged(boolean oldValidState,boolean newValidState)
{ {
//System.out.println("CELLEDITOR: INSIDE EDITORVALUECHANGED: "+oldValidState+","+newValidState); //System.out.println("CELLEDITOR: INSIDE EDITORVALUECHANGED: "+oldValidState+","+newValidState);
} }
/** /**
@ -581,14 +581,14 @@ public class SystemRenameDialog extends SystemPromptDialog
{ {
nameValidator = rows[idx].getNameValidator(); nameValidator = rows[idx].getNameValidator();
inputElement = rows[idx].getElement(); inputElement = rows[idx].getElement();
uniqueNameValidator = setUniqueNameValidator(inputElement, nameValidator); uniqueNameValidator = setUniqueNameValidator(inputElement, nameValidator);
rows[idx].setUniqueNameValidator(uniqueNameValidator); rows[idx].setUniqueNameValidator(uniqueNameValidator);
} }
} }
/** /**
* Given an input element and externally-suppplied name validator for it, determine if we * Given an input element and externally-suppplied name validator for it, determine if we
* need to augment that validator with one that will check for uniqueness, and if so * need to augment that validator with one that will check for uniqueness, and if so
* create and register that uniqueness validator * create and register that uniqueness validator
*/ */
protected ValidatorUniqueString setUniqueNameValidator(Object inputElement, ISystemValidator nameValidator) protected ValidatorUniqueString setUniqueNameValidator(Object inputElement, ISystemValidator nameValidator)
@ -612,7 +612,7 @@ public class SystemRenameDialog extends SystemPromptDialog
System.out.println("No existing name list found for parent " + parentName); //$NON-NLS-1$ System.out.println("No existing name list found for parent " + parentName); //$NON-NLS-1$
} }
if ((ra != null) && (parentName != null)) if ((ra != null) && (parentName != null))
{ {
String[] names = null; String[] names = null;
boolean caseSensitive = ra.getSubSystem(inputElement).getSubSystemConfiguration().isCaseSensitive(); boolean caseSensitive = ra.getSubSystem(inputElement).getSubSystemConfiguration().isCaseSensitive();
boolean needUniqueNameValidator = !(nameValidator instanceof ISystemValidatorUniqueString); boolean needUniqueNameValidator = !(nameValidator instanceof ISystemValidatorUniqueString);
@ -625,7 +625,7 @@ public class SystemRenameDialog extends SystemPromptDialog
{ {
// Set the busy cursor to all shells. // Set the busy cursor to all shells.
super.setBusyCursor(true); super.setBusyCursor(true);
try { try {
names = ra.getRemoteParentNamesInUse(inputElement, null); names = ra.getRemoteParentNamesInUse(inputElement, null);
} catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);} //$NON-NLS-1$ } catch (Exception exc) {SystemBasePlugin.logError("Exception getting parent's child names in rename dialog",exc);} //$NON-NLS-1$
if ((names != null) && (names.length>0)) if ((names != null) && (names.length>0))
@ -644,7 +644,7 @@ public class SystemRenameDialog extends SystemPromptDialog
// Restore cursor // Restore cursor
super.setBusyCursor(false); super.setBusyCursor(false);
} }
} }
return uniqueNameValidator; return uniqueNameValidator;
} }
@ -652,9 +652,9 @@ public class SystemRenameDialog extends SystemPromptDialog
* Returns the implementation of ISystemRemoteElement for the given * Returns the implementation of ISystemRemoteElement for the given
* object. Returns null if this object does not adaptable to this. * object. Returns null if this object does not adaptable to this.
*/ */
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o) protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
{ {
if (!(o instanceof IAdaptable)) if (!(o instanceof IAdaptable))
return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class); return (ISystemRemoteElementAdapter)Platform.getAdapterManager().getAdapter(o,ISystemRemoteElementAdapter.class);
return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class); return (ISystemRemoteElementAdapter)((IAdaptable)o).getAdapter(ISystemRemoteElementAdapter.class);
} }
@ -664,8 +664,8 @@ public class SystemRenameDialog extends SystemPromptDialog
public void focusGained(FocusEvent e) public void focusGained(FocusEvent e)
{ {
/* /*
IStructuredSelection selection = (IStructuredSelection)tableViewer.getSelection(); IStructuredSelection selection = (IStructuredSelection)tableViewer.getSelection();
if (selection.isEmpty()) if (selection.isEmpty())
{ {
currRow = -1; currRow = -1;
return; return;
@ -674,10 +674,10 @@ public class SystemRenameDialog extends SystemPromptDialog
int rowIdx = srtp.getRowNumber(selectedRow); int rowIdx = srtp.getRowNumber(selectedRow);
if (rowIdx == currRow) if (rowIdx == currRow)
return; return;
currRow = rowIdx; currRow = rowIdx;
tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME); tableViewer.editElement(getRows()[rowIdx], COLUMN_NEWNAME);
*/ */
//System.out.println("Focus gained"); //System.out.println("Focus gained");
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent) * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,12 +7,12 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David McKnight (IBM) - [226143] [api][breaking] Make RSE rename/delete dialogs internal
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
@ -38,16 +38,16 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
{ {
static final int COLUMN_ERROR = 0; static final int COLUMN_ERROR = 0;
static final int COLUMN_OLDNAME = 1; static final int COLUMN_OLDNAME = 1;
static final int COLUMN_NEWNAME = 2; static final int COLUMN_NEWNAME = 2;
static final int COLUMN_TYPE = 3; static final int COLUMN_TYPE = 3;
private Map imageTable = new Hashtable(20); private Map imageTable = new Hashtable(20);
private Object[] children = null; private Object[] children = null;
private ISystemValidator inputValidator = null; private ISystemValidator inputValidator = null;
/** /**
* Constructor for SystemRenameTableProvider * Constructor for SystemRenameTableProvider
*/ */
public SystemRenameTableProvider() public SystemRenameTableProvider()
{ {
super(); super();
} }
@ -60,38 +60,38 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
{ {
inputValidator = nameValidator; inputValidator = nameValidator;
} }
private SystemRenameTableRow getTableRow(Object element) private SystemRenameTableRow getTableRow(Object element)
{ {
return (SystemRenameTableRow)element; return (SystemRenameTableRow)element;
} }
private Image getImageFromDescriptor(ImageDescriptor descriptor) private Image getImageFromDescriptor(ImageDescriptor descriptor)
{ {
if (descriptor == null) if (descriptor == null)
return null; return null;
//obtain the cached image corresponding to the descriptor //obtain the cached image corresponding to the descriptor
Image image = (Image) imageTable.get(descriptor); Image image = (Image) imageTable.get(descriptor);
if (image == null) if (image == null)
{ {
image = descriptor.createImage(); image = descriptor.createImage();
imageTable.put(descriptor, image); imageTable.put(descriptor, image);
} }
//System.out.println("...image = " + image); //System.out.println("...image = " + image);
return image; return image;
} }
/** /**
* @see ITableLabelProvider#getColumnImage(java.lang.Object, int) * @see ITableLabelProvider#getColumnImage(java.lang.Object, int)
*/ */
public Image getColumnImage(Object element, int column) public Image getColumnImage(Object element, int column)
{ {
if (column == COLUMN_ERROR) if (column == COLUMN_ERROR)
{ {
SystemRenameTableRow row = getTableRow(element); SystemRenameTableRow row = getTableRow(element);
if (row.getError()) if (row.getError())
{ {
Image errorImage = JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_ERROR); Image errorImage = JFaceResources.getImage(org.eclipse.jface.dialogs.Dialog.DLG_IMG_MESSAGE_ERROR);
//RSEUIPlugin.getDefault().getImage(ISystemConstants.ICON_SYSTEM_ERROR_ID); //RSEUIPlugin.getDefault().getImage(ISystemConstants.ICON_SYSTEM_ERROR_ID);
return errorImage; return errorImage;
} }
@ -107,30 +107,30 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see ITableLabelProvider#getColumnText(java.lang.Object, int) * @see ITableLabelProvider#getColumnText(java.lang.Object, int)
*/ */
public String getColumnText(Object element, int column) public String getColumnText(Object element, int column)
{ {
String text = ""; //$NON-NLS-1$ String text = ""; //$NON-NLS-1$
if (column == COLUMN_OLDNAME) if (column == COLUMN_OLDNAME)
text = getTableRow(element).getName(); text = getTableRow(element).getName();
else if (column == COLUMN_NEWNAME) else if (column == COLUMN_NEWNAME)
text = getTableRow(element).getNewName(); text = getTableRow(element).getNewName();
else if (column == COLUMN_TYPE) else if (column == COLUMN_TYPE)
text = getTableRow(element).getType(); text = getTableRow(element).getType();
//System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element)); //System.out.println("INSIDE GETCOLUMNTEXT: " + column + ", " + text + ", " + getTableRow(element));
return text; return text;
} }
/** /**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/ */
public void addListener(ILabelProviderListener listener) public void addListener(ILabelProviderListener listener)
{ {
} }
/** /**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/ */
public void dispose() public void dispose()
{ {
// The following we got from WorkbenchLabelProvider // The following we got from WorkbenchLabelProvider
if (imageTable != null) if (imageTable != null)
@ -138,11 +138,11 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
Collection imageValues = imageTable.values(); Collection imageValues = imageTable.values();
if (imageValues!=null) if (imageValues!=null)
{ {
Iterator images = imageValues.iterator(); Iterator images = imageValues.iterator();
if (images!=null) if (images!=null)
while (images.hasNext()) while (images.hasNext())
((Image)images.next()).dispose(); ((Image)images.next()).dispose();
imageTable = null; imageTable = null;
} }
} }
} }
@ -150,7 +150,7 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
*/ */
public boolean isLabelProperty(Object element, String property) public boolean isLabelProperty(Object element, String property)
{ {
return true; return true;
} }
@ -158,10 +158,10 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
/** /**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/ */
public void removeListener(ILabelProviderListener listener) public void removeListener(ILabelProviderListener listener)
{ {
} }
/** /**
* Return rows. Input must be an IStructuredSelection. * Return rows. Input must be an IStructuredSelection.
*/ */
@ -175,7 +175,7 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
int idx = 0; int idx = 0;
while (i.hasNext()) while (i.hasNext())
{ {
children[idx] = new SystemRenameTableRow(i.next(),idx); children[idx] = new SystemRenameTableRow(i.next(),idx);
if (inputValidator != null) if (inputValidator != null)
((SystemRenameTableRow)children[idx]).setNameValidator(inputValidator); ((SystemRenameTableRow)children[idx]).setNameValidator(inputValidator);
idx++; idx++;
@ -183,14 +183,14 @@ public class SystemRenameTableProvider implements ITableLabelProvider, IStructur
} }
return children; return children;
} }
/** /**
* *
*/ */
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
{ {
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,12 +7,12 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David McKnight (IBM) - [226143] [api][breaking] Make RSE rename/delete dialogs internal
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
@ -29,12 +29,12 @@ import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
public class SystemRenameTableRow extends SystemDeleteTableRow public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
private String newName; private String newName;
private SystemMessage errorMsg = null; private SystemMessage errorMsg = null;
private ISystemValidator inputValidator = null; private ISystemValidator inputValidator = null;
private ValidatorUniqueString inputUniqueNameValidator = null; private ValidatorUniqueString inputUniqueNameValidator = null;
private Object parent; private Object parent;
private int nameLengthLimit = -1; private int nameLengthLimit = -1;
/** /**
* Constructor * Constructor
* @param element that is being displayed in the tree, and which the * @param element that is being displayed in the tree, and which the
@ -44,12 +44,12 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
super(element,rowNbr); super(element,rowNbr);
this.newName = getName(); this.newName = getName();
this.inputValidator = getViewAdapter(element).getNameValidator(element); this.inputValidator = getViewAdapter(element).getNameValidator(element);
if (inputValidator != null) { if (inputValidator != null) {
nameLengthLimit = inputValidator.getMaximumNameLength(); nameLengthLimit = inputValidator.getMaximumNameLength();
} }
} }
/** /**
* Set the new name for this element. Called by the CellModifier * Set the new name for this element. Called by the CellModifier
* for the rename dialog. * for the rename dialog.
@ -67,7 +67,7 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
else else
newName = null; newName = null;
} }
/** /**
* Trim leading blanks * Trim leading blanks
*/ */
@ -75,7 +75,7 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
return ("."+text).trim().substring(1); //$NON-NLS-1$ return ("."+text).trim().substring(1); //$NON-NLS-1$
} }
/** /**
* Return the new name for this element, as set by setNewName * Return the new name for this element, as set by setNewName
*/ */
@ -83,7 +83,7 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
return newName; return newName;
} }
/** /**
* Get the parent of this remote object that is being renamed * Get the parent of this remote object that is being renamed
*/ */
@ -103,10 +103,10 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
/** /**
* Get the canonical name of this row. Sometimes, the name alone is not enough to do uniqueness * Get the canonical name of this row. Sometimes, the name alone is not enough to do uniqueness
* checking on. For example, two connections or filter pools can have the same name if they are * checking on. For example, two connections or filter pools can have the same name if they are
* in different profiles. Two iSeries QSYS objects can have the same name if their object types * in different profiles. Two iSeries QSYS objects can have the same name if their object types
* are different. * are different.
* <p> * <p>
* This method returns a name that can be used for uniqueness checking because it is qualified * This method returns a name that can be used for uniqueness checking because it is qualified
* sufficiently to make it unique. * sufficiently to make it unique.
* <p> * <p>
* Defers to the object's adapter * Defers to the object's adapter
@ -114,14 +114,14 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
public String getCanonicalNewName() public String getCanonicalNewName()
{ {
// this is all for defect 42145 // this is all for defect 42145
Object element = super.getElement(); Object element = super.getElement();
ISystemViewElementAdapter adapter = super.getViewAdapter(); ISystemViewElementAdapter adapter = super.getViewAdapter();
String cName = newName; String cName = newName;
if (adapter != null) if (adapter != null)
cName = adapter.getCanonicalNewName(element, newName); cName = adapter.getCanonicalNewName(element, newName);
else else
cName = newName; cName = newName;
//System.out.println("Inside getCanonicalNewName: newName: " + newName + ", canonical: " + cName); //System.out.println("Inside getCanonicalNewName: newName: " + newName + ", canonical: " + cName);
return cName; return cName;
} }
/** /**
@ -130,14 +130,14 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
*/ */
public boolean newNameEqualsOldName() public boolean newNameEqualsOldName()
{ {
Object element = super.getElement(); Object element = super.getElement();
ISystemViewElementAdapter adapter = super.getViewAdapter(); ISystemViewElementAdapter adapter = super.getViewAdapter();
if (adapter != null) if (adapter != null)
return adapter.namesAreEqual(element, newName); return adapter.namesAreEqual(element, newName);
else else
return getName().equals(newName); return getName().equals(newName);
} }
/** /**
* Return the name length limit, if available via the name validator supplied by the adapter. * Return the name length limit, if available via the name validator supplied by the adapter.
* Returns -1 if not available. * Returns -1 if not available.
@ -163,14 +163,14 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
inputUniqueNameValidator = uniqueNameValidator; inputUniqueNameValidator = uniqueNameValidator;
} }
/** /**
* Return the validator for the new name,as supplied by the adaptor for * Return the validator for the new name,as supplied by the adaptor for
* this element type. * this element type.
* <p> * <p>
* By default queries it from the object's adapter, unless setNameValidator has been * By default queries it from the object's adapter, unless setNameValidator has been
* called. * called.
*/ */
public ISystemValidator getNameValidator() public ISystemValidator getNameValidator()
{ {
return inputValidator; return inputValidator;
@ -178,7 +178,7 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
/** /**
* Return the uniqueness validator for the new name,as supplied by the call to setUniqueNameValidator * Return the uniqueness validator for the new name,as supplied by the call to setUniqueNameValidator
*/ */
public ValidatorUniqueString getUniqueNameValidator() public ValidatorUniqueString getUniqueNameValidator()
{ {
return inputUniqueNameValidator; return inputUniqueNameValidator;
@ -197,7 +197,7 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
public SystemMessage getErrorMessage() public SystemMessage getErrorMessage()
{ {
return errorMsg; return errorMsg;
} }
/** /**
* Set error message for this row. * Set error message for this row.
* Pass null to clear it. * Pass null to clear it.
@ -206,9 +206,9 @@ public class SystemRenameTableRow extends SystemDeleteTableRow
{ {
this.errorMsg = errorMsg; this.errorMsg = errorMsg;
} }
public String toString() public String toString()
{ {
return getNewName(); return getNewName();
} }
} }