Runtime

org.eclipse.gmf.runtime.common.ui.util
Class TreeInlineTextEditor

java.lang.Object
  extended byorg.eclipse.gmf.runtime.common.ui.util.TreeInlineTextEditor

public class TreeInlineTextEditor
extends java.lang.Object

A class that enables inline-text editing for tree nodes


Constructor Summary
TreeInlineTextEditor(TreeViewer treeViewer, IActionBars actionBars, java.util.List disableActionsIds, IEditStringProvider editStringProvider)
          Constructor for TreeInlineTextEditor.
TreeInlineTextEditor(TreeViewer treeViewer, IEditStringProvider editStringProvider, boolean isF2disabled)
          Constructor for TreeInlineTextEditor.
 
Method Summary
 void cancelEdit()
          cancels the editing process
 boolean canEdit()
          answers if we can start editing
 void dispose()
          Disposes the text widget and reset the editorText field.
 void endEdit()
          ends the editing process
 java.lang.String getCurrentText()
          return the current text
 java.lang.String getFinalText()
          returns the comitted string by the user when editing ended (not-canclled)
 java.lang.String getInitialText()
          returns the initial value when editing started
 boolean isDisposed()
          answers whether this inline-editor has been disposed
protected  void openErrorDialog(IStatus status)
          Opens an error dialog for the specified status object.
 void startEdit()
          starts the editing process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeInlineTextEditor

public TreeInlineTextEditor(TreeViewer treeViewer,
                            IActionBars actionBars,
                            java.util.List disableActionsIds,
                            IEditStringProvider editStringProvider)
Constructor for TreeInlineTextEditor.


TreeInlineTextEditor

public TreeInlineTextEditor(TreeViewer treeViewer,
                            IEditStringProvider editStringProvider,
                            boolean isF2disabled)
Constructor for TreeInlineTextEditor.

Parameters:
treeViewer - the tree viewer
editStringProvider -
isF2disabled - boolean flag indicating whether F2 is disabled
Method Detail

isDisposed

public boolean isDisposed()
answers whether this inline-editor has been disposed

Returns:
boolean indicating its dispose status

canEdit

public boolean canEdit()
answers if we can start editing

Returns:
boolean indicating if we can start editing

startEdit

public void startEdit()
starts the editing process


cancelEdit

public void cancelEdit()
cancels the editing process


endEdit

public void endEdit()
ends the editing process


openErrorDialog

protected void openErrorDialog(IStatus status)
Opens an error dialog for the specified status object.

Parameters:
status - The status object for which to open an error dialog.

dispose

public void dispose()
Disposes the text widget and reset the editorText field. It becomes unreusable afterwards


getCurrentText

public java.lang.String getCurrentText()
return the current text

Returns:
String the text currently in the text widget, or null if it is disposed already

getInitialText

public java.lang.String getInitialText()
returns the initial value when editing started

Returns:
String the last initial value used when editing last started

getFinalText

public java.lang.String getFinalText()
returns the comitted string by the user when editing ended (not-canclled)

Returns:
String the comitted string by the user

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.