mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-30 21:55:31 +02:00
bug 279502: User friendly icons for Paths&Symbols and Includes tree in Project Explorer
Added icon for built-in include folders. Also new icon for workspace and using plain folder icon for filesystem folders.
This commit is contained in:
parent
676f59f8ff
commit
1656612800
6 changed files with 41 additions and 12 deletions
BIN
core/org.eclipse.cdt.ui/icons/obj16/fldr_sys_obj.gif
Normal file
BIN
core/org.eclipse.cdt.ui/icons/obj16/fldr_sys_obj.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 238 B |
Binary file not shown.
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 918 B |
Binary file not shown.
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 366 B |
|
@ -98,6 +98,7 @@ public class CPluginImages {
|
|||
public static final String IMG_OBJS_TUNIT_RESOURCE_H= NAME_PREFIX + "ch_resource_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_TUNIT_RESOURCE_A= NAME_PREFIX + "asm_resource_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_SOURCE_ROOT= NAME_PREFIX + "sroot_obj.gif"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_FOLDER= NAME_PREFIX + "fldr_obj.gif"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_CFOLDER= NAME_PREFIX + "cfolder_obj.gif"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_CONFIG = NAME_PREFIX + "config.gif"; // $NON-NLS-1$ //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_ARCHIVE= NAME_PREFIX + "ar_obj.gif"; //$NON-NLS-1$
|
||||
|
@ -114,6 +115,7 @@ public class CPluginImages {
|
|||
public static final String IMG_OBJS_INCLUDES_CONTAINER = NAME_PREFIX + "includes_container.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_INCLUDES_FOLDER = NAME_PREFIX + "hfolder_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_QUOTE_INCLUDES_FOLDER = NAME_PREFIX + "hfolder_quote_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_INCLUDES_FOLDER_SYSTEM = NAME_PREFIX + "fldr_sys_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_INCLUDES_FOLDER_WORKSPACE = NAME_PREFIX + "wsp_includefolder.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_ORDER= NAME_PREFIX + "cp_order_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_EXCLUDSION_FILTER_ATTRIB= NAME_PREFIX + "exclusion_filter_attrib.gif"; //$NON-NLS-1$
|
||||
|
@ -180,6 +182,7 @@ public class CPluginImages {
|
|||
public static final ImageDescriptor DESC_OBJS_TUNIT_RESOURCE_H= createManaged(T_OBJ, IMG_OBJS_TUNIT_RESOURCE_H);
|
||||
public static final ImageDescriptor DESC_OBJS_TUNIT_RESOURCE_A= createManaged(T_OBJ, IMG_OBJS_TUNIT_RESOURCE_A);
|
||||
public static final ImageDescriptor DESC_OBJS_SOURCE_ROOT= createManaged(T_OBJ, IMG_OBJS_SOURCE_ROOT);
|
||||
public static final ImageDescriptor DESC_OBJS_FOLDER= createManaged(T_OBJ, IMG_OBJS_FOLDER);
|
||||
public static final ImageDescriptor DESC_OBJS_CFOLDER= createManaged(T_OBJ, IMG_OBJS_CFOLDER);
|
||||
public static final ImageDescriptor DESC_OBJS_CONFIG = createManaged(T_OBJ, IMG_OBJS_CONFIG);
|
||||
public static final ImageDescriptor DESC_OBJS_ARCHIVE= createManaged(T_OBJ, IMG_OBJS_ARCHIVE);
|
||||
|
@ -197,6 +200,7 @@ public class CPluginImages {
|
|||
public static final ImageDescriptor DESC_OBJS_INCLUDES_CONTAINER= createManaged(T_OBJ, IMG_OBJS_INCLUDES_CONTAINER);
|
||||
public static final ImageDescriptor DESC_OBJS_INCLUDES_FOLDER= createManaged(T_OBJ, IMG_OBJS_INCLUDES_FOLDER);
|
||||
public static final ImageDescriptor DESC_OBJS_QUOTE_INCLUDES_FOLDER= createManaged(T_OBJ, IMG_OBJS_QUOTE_INCLUDES_FOLDER);
|
||||
public static final ImageDescriptor DESC_OBJS_INCLUDES_FOLDER_SYSTEM = createManaged(T_OBJ, IMG_OBJS_INCLUDES_FOLDER_SYSTEM);
|
||||
public static final ImageDescriptor DESC_OBJS_INCLUDES_FOLDER_WORKSPACE= createManaged(T_OBJ, IMG_OBJS_INCLUDES_FOLDER_WORKSPACE);
|
||||
public static final ImageDescriptor DESC_OBJS_ORDER= createManaged(T_OBJ, IMG_OBJS_ORDER);
|
||||
public static final ImageDescriptor DESC_OBJS_EXCLUSION_FILTER_ATTRIB = createManaged(T_OBJ, IMG_OBJS_EXCLUDSION_FILTER_ATTRIB);
|
||||
|
|
|
@ -116,9 +116,12 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
|
||||
private static final Comparator<Object> comp = CDTListComparator.getInstance();
|
||||
|
||||
private final static Image IMG_FS = CPluginImages.get(CPluginImages.IMG_FILESYSTEM);
|
||||
private final static Image IMG_WS = CPluginImages.get(CPluginImages.IMG_WORKSPACE);
|
||||
private final static Image IMG_MK = CPluginImages.get(CPluginImages.IMG_OBJS_MACRO);
|
||||
private final static Image IMG_FOLDER = CPluginImages.get(CPluginImages.IMG_OBJS_FOLDER);
|
||||
private final static Image IMG_INCLUDES_FOLDER = CPluginImages.get(CPluginImages.IMG_OBJS_INCLUDES_FOLDER);
|
||||
private final static Image IMG_BUILTIN_FOLDER = CPluginImages.get(CPluginImages.IMG_OBJS_INCLUDES_FOLDER_SYSTEM);
|
||||
private final static Image IMG_WORKSPACE = CPluginImages.get(CPluginImages.IMG_WORKSPACE);
|
||||
private final static Image IMG_INCLUDES_FOLDER_WORKSPACE = CPluginImages.get(CPluginImages.IMG_OBJS_INCLUDES_FOLDER_WORKSPACE);
|
||||
private final static Image IMG_MACRO = CPluginImages.get(CPluginImages.IMG_OBJS_MACRO);
|
||||
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 30 };
|
||||
|
||||
@Override
|
||||
|
@ -683,12 +686,25 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
public Image getColumnImage(Object element, int columnIndex) {
|
||||
if (columnIndex > 0) return null;
|
||||
if (! (element instanceof ICLanguageSettingEntry)) return null;
|
||||
|
||||
ICLanguageSettingEntry le = (ICLanguageSettingEntry) element;
|
||||
if (le.getKind() == ICSettingEntry.MACRO)
|
||||
return IMG_MK;
|
||||
if ((le.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0)
|
||||
return IMG_WS;
|
||||
return IMG_FS;
|
||||
return IMG_MACRO;
|
||||
if ((le.getFlags() & ICSettingEntry.BUILTIN) != 0)
|
||||
return IMG_BUILTIN_FOLDER;
|
||||
|
||||
boolean isWorkspacePath = (le.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0;
|
||||
if (le.getKind() == ICSettingEntry.INCLUDE_PATH || le.getKind() == ICSettingEntry.INCLUDE_FILE) {
|
||||
if (isWorkspacePath)
|
||||
return IMG_INCLUDES_FOLDER_WORKSPACE;
|
||||
else
|
||||
return IMG_INCLUDES_FOLDER;
|
||||
} else {
|
||||
if (isWorkspacePath)
|
||||
return IMG_WORKSPACE;
|
||||
else
|
||||
return IMG_FOLDER;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.newui;
|
||||
|
||||
//import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -30,6 +30,8 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
|||
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.CPluginImages;
|
||||
|
||||
/**
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
*/
|
||||
|
@ -125,9 +127,9 @@ public class IncludeDialog extends AbstractPropertyDialog {
|
|||
c_wsp.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
c_wsp.setImage(AbstractExportTab.getWspImage(c_wsp.getSelection()));
|
||||
c_wsp.setImage(getWspImage(c_wsp.getSelection()));
|
||||
}});
|
||||
c_wsp.setImage(AbstractExportTab.getWspImage(isWsp));
|
||||
c_wsp.setImage(getWspImage(isWsp));
|
||||
|
||||
// Buttons
|
||||
Composite c2 = new Composite (c, SWT.NONE);
|
||||
|
@ -187,7 +189,7 @@ public class IncludeDialog extends AbstractPropertyDialog {
|
|||
s = strip_wsp(s);
|
||||
text.setText(s);
|
||||
c_wsp.setSelection(true);
|
||||
c_wsp.setImage(AbstractExportTab.getWspImage(c_wsp.getSelection()));
|
||||
c_wsp.setImage(getWspImage(c_wsp.getSelection()));
|
||||
}
|
||||
} else if (e.widget.equals(b_file)) {
|
||||
if ((mode & DIR_MASK)== DIR_MASK)
|
||||
|
@ -197,11 +199,18 @@ public class IncludeDialog extends AbstractPropertyDialog {
|
|||
if (s != null) {
|
||||
text.setText(s);
|
||||
c_wsp.setSelection(false);
|
||||
c_wsp.setImage(AbstractExportTab.getWspImage(c_wsp.getSelection()));
|
||||
c_wsp.setImage(getWspImage(c_wsp.getSelection()));
|
||||
}
|
||||
} else if (e.widget.equals(b_vars)) {
|
||||
s = AbstractCPropertyTab.getVariableDialog(shell, cfgd);
|
||||
if (s != null) text.insert(s);
|
||||
}
|
||||
}
|
||||
|
||||
static private Image getWspImage(boolean isWsp) {
|
||||
final Image IMG_WORKSPACE = CPluginImages.get(CPluginImages.IMG_WORKSPACE);
|
||||
final Image IMG_FILESYSTEM = CPluginImages.get(CPluginImages.IMG_OBJS_FOLDER);
|
||||
return isWsp ? IMG_WORKSPACE : IMG_FILESYSTEM;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue