Skip to content

Commit

Permalink
Summary:
Browse files Browse the repository at this point in the history
Merge "<value-of format HTML>" into "value-of______" combo
in "Edit Text Item".
  • Loading branch information
yuxuandai committed Jan 30, 2014
1 parent 6079685 commit fa44d31
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3981,8 +3981,8 @@ TextEditDialog.toolTipText.delete=Delete
TextEditDialog.toolTipText.paste=Paste
TextEditDialog.toolTipText.redo=Redo
TextEditDialog.toolTipText.undo=Undo
TextEditDialog.toolTip.formatHTML=format HTML
TextEditDialog.toolTipText.fx=Open expression builder
TextEditDialog.action.item.formatHTML=format HTML
TextEditDialog.action.item.formatDateTime=Format DateTime
TextEditDialog.action.item.formatNumber=Format Number
TextEditDialog.action.item.formatString=Format String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,8 @@ private void createFormatTags( int index, ToolBar toolBar )
}
switch ( index )
{
// Creates tags of formatting.
// case 0 :
// Creates tags of formatting.
// case 0 :
case FORMAT_CHOICE_INDEX_FORMATTING :
{
tag = new HTMLTag( "<H1>", true ); //$NON-NLS-1$
Expand Down Expand Up @@ -1039,9 +1039,9 @@ private void createFormatTags( int index, ToolBar toolBar )
toolBar.getParent( ).layout( true, true );
break;
}
// Creates tags of layout.
// Creates tags of layout.
case FORMAT_CHOICE_INDEX_LAYOUT :
// case 1 :
// case 1 :
{
tag = new HTMLTag( "<CENTER>", true ); //$NON-NLS-1$
tag.setToolTipText( TOOL_TIP_TAG_CENTER );
Expand All @@ -1067,8 +1067,8 @@ private void createFormatTags( int index, ToolBar toolBar )
toolBar.getParent( ).layout( true, true );
break;
}
// Creates tags of content.
// case 2 :
// Creates tags of content.
// case 2 :
case FORMAT_CHOICE_INDEX_CONTENT :
{
tag = new HTMLTag( "<IMG>", false ); //$NON-NLS-1$
Expand Down Expand Up @@ -1104,9 +1104,9 @@ private void createFormatTags( int index, ToolBar toolBar )
toolBar.getParent( ).layout( true, true );
break;
}
// Creates tags of list.
// Creates tags of list.
case FORMAT_CHOICE_INDEX_LISTS :
// case 3 :
// case 3 :
{
tag = new HTMLTag( "<DL>", true ); //$NON-NLS-1$
tag.setToolTipText( TOOL_TIP_TAG_DL );
Expand All @@ -1132,8 +1132,8 @@ private void createFormatTags( int index, ToolBar toolBar )
toolBar.getParent( ).layout( true, true );
break;
}
// Creates tags for Dynamic Text.
// case 4 :
// Creates tags for Dynamic Text.
// case 4 :
case FORMAT_CHOICE_INDEX_DYNAMIC_TEXT :
{
final ToolItem value = new ToolItem( toolBar, SWT.NONE );
Expand Down Expand Up @@ -1166,19 +1166,20 @@ public void widgetSelected( SelectionEvent e )
}
} );

final ToolItem formatHTML = new ToolItem( toolBar, SWT.NONE );
formatHTML.setText( "<VALUE-OF Format HTML>" ); //$NON-NLS-1$
formatHTML.setToolTipText( TOOL_TIP_FORMAT_HTML );
formatHTML.addSelectionListener( new SelectionAdapter( ) {

public void widgetSelected( SelectionEvent e )
{
String result = " format=\"HTML\""; //$NON-NLS-1$
textEditor.insert( result );
}
} );

new ToolItem( toolBar, SWT.SEPARATOR );
// final ToolItem formatHTML = new ToolItem( toolBar, SWT.NONE
// );
// formatHTML.setText( "<VALUE-OF Format HTML>" ); //$NON-NLS-1$
// formatHTML.setToolTipText( TOOL_TIP_FORMAT_HTML );
// formatHTML.addSelectionListener( new SelectionAdapter( ) {
//
// public void widgetSelected( SelectionEvent e )
// {
// String result = " format=\"HTML\""; //$NON-NLS-1$
// textEditor.insert( result );
// }
// } );
//
// new ToolItem( toolBar, SWT.SEPARATOR );

formatParent = new Composite( toolBar.getParent( ), SWT.NONE );
GridLayout gdLayout = new GridLayout( );
Expand All @@ -1198,6 +1199,7 @@ public void widgetSelected( SelectionEvent e )
.getDisplay( )
.getSystemColor( SWT.COLOR_LIST_BACKGROUND ) );
combo.setItems( new String[]{
Messages.getString( "TextEditDialog.action.item.formatHTML" ), //$NON-NLS-1$
Messages.getString( "TextEditDialog.action.item.formatNumber" ), //$NON-NLS-1$
Messages.getString( "TextEditDialog.action.item.formatString" ), //$NON-NLS-1$
Messages.getString( "TextEditDialog.action.item.formatDateTime" ), //$NON-NLS-1$
Expand Down Expand Up @@ -1586,12 +1588,16 @@ protected void handleFormatSelectionEvent( final CCombo combo )
switch ( index )
{
case 0 :
insertFormat( FormatBuilder.NUMBER );
String result = " format=\"HTML\""; //$NON-NLS-1$
textEditor.insert( result );
break;
case 1 :
insertFormat( FormatBuilder.STRING );
insertFormat( FormatBuilder.NUMBER );
break;
case 2 :
insertFormat( FormatBuilder.STRING );
break;
case 3 :
insertFormat( FormatBuilder.DATETIME );
break;
default :
Expand Down

0 comments on commit fa44d31

Please sign in to comment.