Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
BZ-1195300: tooltips for workbench extensions (plugins and apps).
Browse files Browse the repository at this point in the history
  • Loading branch information
jrenaat committed Mar 13, 2015
1 parent 3fd964f commit a08b13f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private TilesApp( TYPE type,
Directory currentDirectory ) {
initWidget( uiBinder.createAndBindUi( this ) );
defineTileColor( type );
createIcon( type );
createIcon( type, CommonConstants.INSTANCE.CreateDir() );
displayNoneOnLabel();
addClickPopUpHandler( clickCommand, currentDirectory );
}
Expand All @@ -81,7 +81,7 @@ private TilesApp( String componentName,
final ParameterizedCommand<String> clickCommand ) {
initWidget( uiBinder.createAndBindUi( this ) );
defineTileColor( type );
createIcon( type );
createIcon( type, CommonConstants.INSTANCE.GotoComponent() );
createLabel( componentName );
addClickCommandHandler( clickCommand, componentName );
}
Expand All @@ -101,7 +101,7 @@ private TilesApp( String dirName,
final ParameterizedCommand<String> deleteCommand ) {
initWidget( uiBinder.createAndBindUi( this ) );
defineTileColor( type );
createIcon( type );
createIcon( type, CommonConstants.INSTANCE.OpenDir() );
createLabel( dirName );
addClickCommandHandler( clickCommand, dirURI );
createDeleteIcon( deleteCommand, dirURI );
Expand All @@ -111,6 +111,7 @@ private void createDeleteIcon( final ParameterizedCommand<String> deleteCommand,
final String dirURI ) {
deleteIcon = new Icon( IconType.REMOVE );
deleteIcon.setIconSize( IconSize.LARGE );
deleteIcon.setTitle( CommonConstants.INSTANCE.DeleteDir() );
deleteIcon.addStyleName( APP_CSS.CSS().deleteIcon() );
deleteIcon.addDomHandler( new ClickHandler() {
@Override
Expand Down Expand Up @@ -168,8 +169,9 @@ private void createLabel( String name ) {
label.setText( name );
}

private void createIcon( TYPE type ) {
private void createIcon( TYPE type, String tooltip ) {
icon.setIconSize( IconSize.LARGE );
icon.setTitle( tooltip );
icon.setType( type.icon() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public interface CommonConstants

String CreateDir();

String DeleteDir();

String OpenDir();

String DirName();

String DirNameHolder();
Expand All @@ -25,4 +29,5 @@ public interface CommonConstants

String DeleteAppPrompt();

String GotoComponent();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
CreateDir=Create Directory
DeleteDir=Delete Directory
OpenDir=Open Directory
DirName=Directory Name
DirNameHolder=directory name
DuplicateDirName=There is already a directory with this name
InvalidDirName=Invalid Directory Name
OK=OK
Cancel=Cancel
DeleteAppPrompt=Are you sure you want to delete this Directory?
DeleteAppPrompt=Are you sure you want to delete this Directory?
GotoComponent=Go to component
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.google.gwt.user.client.ui.Widget;
import org.uberfire.ext.plugin.client.perspective.editor.api.ExternalPerspectiveEditorComponent;
import org.uberfire.ext.plugin.client.perspective.editor.util.DragType;
import org.uberfire.ext.plugin.client.resources.i18n.CommonConstants;
import org.uberfire.workbench.events.NotificationEvent;

public class DragGridElement extends Composite {
Expand Down Expand Up @@ -63,6 +64,7 @@ private void build() {
}

private void createMoveIcon( final DragType type ) {
move.setTitle( CommonConstants.INSTANCE.DragAndDrop() );
move.addDomHandler( new DragStartHandler() {
@Override
public void onDragStart( DragStartEvent event ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ public interface CommonConstants

String MenusLabelIsManatory();

String DragAndDrop();

String ClickToDisplay();

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.IsWidget;
import org.uberfire.ext.plugin.client.resources.i18n.CommonConstants;

/**
* Trigger Widget for ResourceType groups
Expand All @@ -35,7 +36,7 @@ public TriggerWidget( final String caption ) {
initWidget( resourceHeader );
resourceHeader.setWidget( 0, 0, makeNavHeader( caption ) );
resourceHeader.setHTML( 0, 1, "&nbsp;&nbsp;" );
resourceHeader.setWidget( 0, 2, new Icon( IconType.CARET_DOWN ) );
resourceHeader.setWidget( 0, 2, makeIcon( IconType.CARET_DOWN, CommonConstants.INSTANCE.ClickToDisplay() ) );
}

public TriggerWidget( final IsWidget icon,
Expand All @@ -46,14 +47,21 @@ public TriggerWidget( final IsWidget icon,
resourceHeader.setHTML( 0, 1, "&nbsp;&nbsp;" );
resourceHeader.setWidget( 0, 2, makeNavHeader( caption ) );
resourceHeader.setHTML( 0, 3, "&nbsp;&nbsp;" );
resourceHeader.setWidget( 0, 4, new Icon( IconType.CARET_DOWN ) );
resourceHeader.setWidget( 0, 4, makeIcon( IconType.CARET_DOWN, CommonConstants.INSTANCE.ClickToDisplay() ) );
}

private NavHeader makeNavHeader( final String caption ) {
final NavHeader nh = new NavHeader( caption );
nh.setTitle( CommonConstants.INSTANCE.ClickToDisplay() );
nh.getElement().getStyle().setFontWeight( Style.FontWeight.BOLD );
nh.getElement().getStyle().setColor( "#000000" );
return nh;
}

private Icon makeIcon( IconType iconType, String tooltip ) {
Icon icon = new Icon( iconType );
icon.setTitle( tooltip );
return icon;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ MenusDeleteHint=Delete row.
MenusDelete=Delete
MenusActivityIDIsManatory=An Activity ID is mandatory and cannot be empty.
MenusLabelIsManatory=A Label is mandatory and cannot be empty.
DragAndDrop=Drag and drop
ClickToDisplay=Click to show/hide plugins

0 comments on commit a08b13f

Please sign in to comment.