mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Added tooltips to the Memory view's tabs.
This commit is contained in:
parent
9f5ea6519c
commit
7b0abedd4f
2 changed files with 37 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2002-11-13 Mikhail Khodjaiants
|
||||||
|
Added tooltips to the Memory view's tabs.
|
||||||
|
* MemoryControlArea.java
|
||||||
|
|
||||||
2002-11-13 Mikhail Khodjaiants
|
2002-11-13 Mikhail Khodjaiants
|
||||||
Added the 'Auto-Refresh by default' and 'Show ASCII by default' preferences
|
Added the 'Auto-Refresh by default' and 'Show ASCII by default' preferences
|
||||||
to the 'Memory Views' preference page.
|
to the 'Memory Views' preference page.
|
||||||
|
|
|
@ -69,6 +69,7 @@ public class MemoryControlArea extends Composite
|
||||||
fAddressText = createAddressText( this );
|
fAddressText = createAddressText( this );
|
||||||
fMemoryText = createMemoryText( this, style, fPresentation );
|
fMemoryText = createMemoryText( this, style, fPresentation );
|
||||||
setDefaultPreferences();
|
setDefaultPreferences();
|
||||||
|
updateToolTipText();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultPreferences()
|
private void setDefaultPreferences()
|
||||||
|
@ -257,6 +258,7 @@ public class MemoryControlArea extends Composite
|
||||||
getPresentation().setMemoryBlock( getMemoryBlock() );
|
getPresentation().setMemoryBlock( getMemoryBlock() );
|
||||||
}
|
}
|
||||||
setMemoryTextState();
|
setMemoryTextState();
|
||||||
|
updateToolTipText();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeBlock() throws DebugException
|
private void removeBlock() throws DebugException
|
||||||
|
@ -267,6 +269,7 @@ public class MemoryControlArea extends Composite
|
||||||
getPresentation().setMemoryBlock( null );
|
getPresentation().setMemoryBlock( null );
|
||||||
}
|
}
|
||||||
setMemoryTextState();
|
setMemoryTextState();
|
||||||
|
updateToolTipText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFormat()
|
public int getFormat()
|
||||||
|
@ -392,6 +395,16 @@ public class MemoryControlArea extends Composite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setTabItemToolTipText( String text )
|
||||||
|
{
|
||||||
|
String newText = replaceMnemonicCharacters( text );
|
||||||
|
if ( getParent() instanceof CTabFolder )
|
||||||
|
{
|
||||||
|
CTabItem[] tabItems = ((CTabFolder)getParent()).getItems();
|
||||||
|
tabItems[fIndex].setToolTipText( "Memory View " + (fIndex + 1) + ": " + newText );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void refreshMemoryBlock()
|
protected void refreshMemoryBlock()
|
||||||
{
|
{
|
||||||
if ( getMemoryBlock() != null )
|
if ( getMemoryBlock() != null )
|
||||||
|
@ -426,4 +439,24 @@ public class MemoryControlArea extends Composite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateToolTipText()
|
||||||
|
{
|
||||||
|
setTabItemToolTipText( fAddressText.getText().trim() );
|
||||||
|
}
|
||||||
|
|
||||||
|
private String replaceMnemonicCharacters( String text )
|
||||||
|
{
|
||||||
|
StringBuffer sb = new StringBuffer( text.length() );
|
||||||
|
for ( int i = 0; i < text.length(); ++i )
|
||||||
|
{
|
||||||
|
char ch = text.charAt( i );
|
||||||
|
sb.append( ch );
|
||||||
|
if ( ch == '&' )
|
||||||
|
{
|
||||||
|
sb.append( ch );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue