org.eclipse.cdt.ui.newui
Class AbstractCPropertyTab

java.lang.Object
  extended by org.eclipse.cdt.ui.newui.AbstractCPropertyTab
All Implemented Interfaces:
ICPropertyTab
Direct Known Subclasses:
AbstractCBuildPropertyTab, AbstractExportTab, AbstractLangsListTab, BinaryParsTab, CLocationTab, CPropertyVarsTab, EnvironmentTab, ErrorParsTab, PropertyPageDefsTab, RefsTab, StructureTreeTab, WizardDefaultsTab

public abstract class AbstractCPropertyTab
extends java.lang.Object
implements ICPropertyTab

It is a parent for all standard property tabs in new CDT model. Although it's enougth for new tabs to implement ICPropertyTab interface only, it would be better to extend them from this class. In this case, we'll able to use: - a lot of utility methods via "provider" link. In particular, it allows to get current project, configuration etc. See ICPropertyProvider interface. - a standard way to create buttons (ins/edit/del etc) and to handle their events (see buttonPressed(int)) - several utility methods to create widgets in the uniform manner (setupLabel(), setupText() etc). - means to handle control messages which are the main communication way for new CDT model pages and tabs.


Field Summary
static java.lang.String ADD_STR
           
static int BUTTON_WIDTH
           
static java.lang.String DEL_STR
           
static java.lang.String EDIT_STR
           
static java.lang.String EMPTY_STR
           
static java.lang.String FILESYSTEM_DIR_DIALOG_MSG
           
static java.lang.String FILESYSTEM_FILE_DIALOG_TITLE
           
static java.lang.String FILESYSTEMBUTTON_NAME
           
static java.lang.String MOVEDOWN_STR
           
static java.lang.String MOVEUP_STR
           
 ICPropertyProvider page
           
static boolean USE_TRI_STATE
           
static java.lang.String VARIABLESBUTTON_NAME
           
static java.lang.String WORKSPACE_DIR_DIALOG_ERR
           
static java.lang.String WORKSPACE_DIR_DIALOG_MSG
           
static java.lang.String WORKSPACE_DIR_DIALOG_TITLE
           
static java.lang.String WORKSPACE_FILE_DIALOG_ERR
           
static java.lang.String WORKSPACE_FILE_DIALOG_MSG
           
static java.lang.String WORKSPACE_FILE_DIALOG_TITLE
           
static java.lang.String WORKSPACEBUTTON_NAME
           
 
Fields inherited from interface org.eclipse.cdt.ui.newui.ICPropertyTab
APPLY, CANCEL, DEFAULTS, DISPOSE, MANAGEDBUILDSTATE, MAXCOMMON, OK, SET_ICON, UPDATE, VISIBLE
 
Constructor Summary
AbstractCPropertyTab()
           
 
Method Summary
 boolean canBeVisible()
          Returns true (by default) if page's contents is correct Returns false if page cannot be shown because it does not fit to other settings (for example, managed build settings are not possible when managed build is off).
 void createControls(org.eclipse.swt.widgets.Composite _parent, ICPropertyProvider _provider)
          Creation of all visible elements
 void dispose()
          Disposes the SWT resources allocated by this dialog page.
static java.lang.String getFileSystemDirDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String text)
           
static java.lang.String getFileSystemFileDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String text)
           
static org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.widgets.Control control)
          Added to avoid usage PixelConverter class.
 org.eclipse.cdt.core.settings.model.ICResourceDescription getResDesc()
           
static java.lang.String getVariableDialog(org.eclipse.swt.widgets.Shell shell, org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfgd)
           
static java.lang.String getWorkspaceDirDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String text)
           
static java.lang.String getWorkspaceFileDialog(org.eclipse.swt.widgets.Shell shell, java.lang.String text)
           
 void handleTabEvent(int kind, java.lang.Object data)
          Common event handler: called by parent for each tab
 void setVisible(boolean _visible)
          Sets the visibility of this property tab.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON_WIDTH

public static final int BUTTON_WIDTH
See Also:
Constant Field Values

USE_TRI_STATE

public static final boolean USE_TRI_STATE
See Also:
Constant Field Values

EMPTY_STR

public static final java.lang.String EMPTY_STR
See Also:
Constant Field Values

ADD_STR

public static final java.lang.String ADD_STR

DEL_STR

public static final java.lang.String DEL_STR

EDIT_STR

public static final java.lang.String EDIT_STR

MOVEUP_STR

public static final java.lang.String MOVEUP_STR

MOVEDOWN_STR

public static final java.lang.String MOVEDOWN_STR

WORKSPACEBUTTON_NAME

public static final java.lang.String WORKSPACEBUTTON_NAME

FILESYSTEMBUTTON_NAME

public static final java.lang.String FILESYSTEMBUTTON_NAME

VARIABLESBUTTON_NAME

public static final java.lang.String VARIABLESBUTTON_NAME

FILESYSTEM_DIR_DIALOG_MSG

public static final java.lang.String FILESYSTEM_DIR_DIALOG_MSG

FILESYSTEM_FILE_DIALOG_TITLE

public static final java.lang.String FILESYSTEM_FILE_DIALOG_TITLE
See Also:
Constant Field Values

WORKSPACE_DIR_DIALOG_TITLE

public static final java.lang.String WORKSPACE_DIR_DIALOG_TITLE

WORKSPACE_FILE_DIALOG_TITLE

public static final java.lang.String WORKSPACE_FILE_DIALOG_TITLE

WORKSPACE_DIR_DIALOG_MSG

public static final java.lang.String WORKSPACE_DIR_DIALOG_MSG

WORKSPACE_FILE_DIALOG_MSG

public static final java.lang.String WORKSPACE_FILE_DIALOG_MSG

WORKSPACE_FILE_DIALOG_ERR

public static final java.lang.String WORKSPACE_FILE_DIALOG_ERR

WORKSPACE_DIR_DIALOG_ERR

public static final java.lang.String WORKSPACE_DIR_DIALOG_ERR

page

public ICPropertyProvider page
Constructor Detail

AbstractCPropertyTab

public AbstractCPropertyTab()
Method Detail

createControls

public void createControls(org.eclipse.swt.widgets.Composite _parent,
                           ICPropertyProvider _provider)
Description copied from interface: ICPropertyTab
Creation of all visible elements

Specified by:
createControls in interface ICPropertyTab
Parameters:
_parent - - composite where widgets should be created
_provider - - underlying page

dispose

public void dispose()
Disposes the SWT resources allocated by this dialog page.


setVisible

public void setVisible(boolean _visible)
Sets the visibility of this property tab.

Parameters:
_visible - true to make this tab visible, and false to hide it

getFileSystemDirDialog

public static java.lang.String getFileSystemDirDialog(org.eclipse.swt.widgets.Shell shell,
                                                      java.lang.String text)

getFileSystemFileDialog

public static java.lang.String getFileSystemFileDialog(org.eclipse.swt.widgets.Shell shell,
                                                       java.lang.String text)

getVariableDialog

public static java.lang.String getVariableDialog(org.eclipse.swt.widgets.Shell shell,
                                                 org.eclipse.cdt.core.settings.model.ICConfigurationDescription cfgd)

getWorkspaceDirDialog

public static java.lang.String getWorkspaceDirDialog(org.eclipse.swt.widgets.Shell shell,
                                                     java.lang.String text)

getWorkspaceFileDialog

public static java.lang.String getWorkspaceFileDialog(org.eclipse.swt.widgets.Shell shell,
                                                      java.lang.String text)

getResDesc

public org.eclipse.cdt.core.settings.model.ICResourceDescription getResDesc()

handleTabEvent

public void handleTabEvent(int kind,
                           java.lang.Object data)
Common event handler: called by parent for each tab

Specified by:
handleTabEvent in interface ICPropertyTab
Parameters:
kind - - message ID (see AbstractCPropertyTab)
data - - additional info, depanding of message kind.

canBeVisible

public boolean canBeVisible()
Description copied from interface: ICPropertyTab
Returns true (by default) if page's contents is correct Returns false if page cannot be shown because it does not fit to other settings (for example, managed build settings are not possible when managed build is off).

Specified by:
canBeVisible in interface ICPropertyTab

getFontMetrics

public static org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.widgets.Control control)
Added to avoid usage PixelConverter class.

Parameters:
control -
Returns:
FontMetrics