Skip to content

Commit

Permalink
516804: Icons for user action entries
Browse files Browse the repository at this point in the history
Added fontawesome icons to user action entries.

The background color actually looks fine on Windows, Mac and Ubuntu.
I'll leave it like that for now, and resolve the color selection as
part of theming support in bug 489034

Bug: 516804
See-Also: 489034
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
  • Loading branch information
creckord committed May 24, 2017
1 parent 782fa5c commit 0fb9d35
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 16 deletions.
15 changes: 15 additions & 0 deletions org.eclipse.epp.mpc.ui/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,20 @@ <h3>License</h3>
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>

<h3>Third Party Content</h3>

<p>The Content includes items that have been sourced from third parties
as set out below. If you did not receive this Content directly from
the Eclipse Foundation, the following is provided for informational
purposes only, and you should look to the Redistributor's license
for terms and conditions of use.</p>

<h4>FontAwesome 4.5.0</h4>

<p>This plugin includes images created from rasterized glyphs from
<a href="https://fortawesome.github.io/Font-Awesome/">Font Awesome
4.5.0</a> at different resolutions. FontAwesome is available under
the <a href="http://scripts.sil.org/OFL">SIL Open Font License</a>.</p>

</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ public class MarketplaceClientUiPlugin extends AbstractUIPlugin {

public static final String DEFAULT_MARKETPLACE_ICON = "DEFAULT_MARKETPLACE_ICON"; //$NON-NLS-1$

public static final String ACTION_ICON_FAVORITES = "ACTION_ICON_FAVORITES"; //$NON-NLS-1$

public static final String ACTION_ICON_LOGIN = "ACTION_ICON_LOGIN"; //$NON-NLS-1$

public static final String ACTION_ICON_WARNING = "ACTION_ICON_WARNING"; //$NON-NLS-1$

public static final String ITEM_ICON_STAR = "ITEM_ICON_STAR"; //$NON-NLS-1$

public static final String ITEM_ICON_STAR_SELECTED = "ITEM_ICON_STAR_SELECTED"; //$NON-NLS-1$
Expand Down Expand Up @@ -189,6 +195,12 @@ protected ImageRegistry createImageRegistry() {
imageRegistry.put(ITEM_ICON_STAR_SELECTED,
imageDescriptorFromPlugin(getBundle().getSymbolicName(), "icons/star-selected.png")); //$NON-NLS-1$
imageRegistry.put(ITEM_ICON_SHARE, imageDescriptorFromPlugin(getBundle().getSymbolicName(), "icons/share.png")); //$NON-NLS-1$
imageRegistry.put(ACTION_ICON_FAVORITES,
imageDescriptorFromPlugin(getBundle().getSymbolicName(), "icons/action-item-favorites.png")); //$NON-NLS-1$
imageRegistry.put(ACTION_ICON_LOGIN,
imageDescriptorFromPlugin(getBundle().getSymbolicName(), "icons/action-item-login.png")); //$NON-NLS-1$
imageRegistry.put(ACTION_ICON_WARNING,
imageDescriptorFromPlugin(getBundle().getSymbolicName(), "icons/action-item-warning.png")); //$NON-NLS-1$
return imageRegistry;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,4 +811,14 @@ static GridDataFactory createButtonLayoutData(Button button, PixelConverter pixe
dataFactory.minSize(minWidth, SWT.DEFAULT);
return dataFactory;
}

protected static Icon createIcon(String path) {
Icon icon = new Icon();
icon.setImage128(path);
icon.setImage64(path);
icon.setImage32(path);
icon.setImage16(path);
return icon;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public abstract class AbstractUserActionItem extends AbstractMarketplaceDiscover
public AbstractUserActionItem(Composite parent, MarketplaceDiscoveryResources resources,
UserActionCatalogItem connector, CatalogViewer viewer) {
super(parent, SWT.NONE, resources, null, connector, viewer);
//TODO we need a better color definition for this...
//see https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
setBackground(viewer.getControl().getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ protected boolean alignIconWithName() {
@Override
protected Icon getIcon() {
String path = REGISTRY_SCHEME + MarketplaceClientUiPlugin.DEFAULT_MARKETPLACE_ICON;
Icon icon = new Icon();
icon.setImage128(path);
icon.setImage64(path);
icon.setImage32(path);
icon.setImage16(path);
return icon;
return createIcon(path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import org.eclipse.core.runtime.IStatus;
import org.eclipse.epp.internal.mpc.core.MarketplaceClientCore;
import org.eclipse.epp.internal.mpc.ui.MarketplaceClientUiPlugin;
import org.eclipse.epp.internal.mpc.ui.catalog.UserActionCatalogItem;
import org.eclipse.equinox.internal.p2.discovery.model.Icon;
import org.eclipse.jface.dialogs.ErrorDialog;
Expand Down Expand Up @@ -47,8 +48,8 @@ protected String getDescriptionText() {

@Override
protected Icon getIcon() {
// TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
return null;
String path = REGISTRY_SCHEME + MarketplaceClientUiPlugin.ACTION_ICON_WARNING;
return createIcon(path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.epp.internal.mpc.ui.wizards;

import org.eclipse.epp.internal.mpc.ui.MarketplaceClientUiPlugin;
import org.eclipse.epp.internal.mpc.ui.catalog.UserActionCatalogItem;
import org.eclipse.epp.mpc.ui.CatalogDescriptor;
import org.eclipse.equinox.internal.p2.discovery.model.Icon;
Expand Down Expand Up @@ -44,8 +45,8 @@ protected String getDescriptionText() {

@Override
protected Icon getIcon() {
// TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
return null;
String path = REGISTRY_SCHEME + MarketplaceClientUiPlugin.ACTION_ICON_FAVORITES;
return createIcon(path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.eclipse.epp.internal.mpc.ui.wizards;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.epp.internal.mpc.ui.MarketplaceClientUiPlugin;
import org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog;
import org.eclipse.epp.internal.mpc.ui.catalog.UserActionCatalogItem;
import org.eclipse.equinox.internal.p2.discovery.model.Icon;
Expand Down Expand Up @@ -44,8 +45,8 @@ protected String getDescriptionText() {

@Override
protected Icon getIcon() {
// TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
return null;
String path = REGISTRY_SCHEME + MarketplaceClientUiPlugin.ACTION_ICON_LOGIN;
return createIcon(path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.epp.internal.mpc.ui.wizards;

import org.eclipse.epp.internal.mpc.ui.MarketplaceClientUiPlugin;
import org.eclipse.epp.internal.mpc.ui.catalog.UserActionCatalogItem;
import org.eclipse.equinox.internal.p2.discovery.model.Icon;
import org.eclipse.swt.widgets.Composite;
Expand All @@ -36,8 +37,8 @@ protected String getDescriptionText() {

@Override
protected Icon getIcon() {
// TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=516804
return null;
String path = REGISTRY_SCHEME + MarketplaceClientUiPlugin.ACTION_ICON_WARNING;
return createIcon(path);
}

@Override
Expand Down

0 comments on commit 0fb9d35

Please sign in to comment.