1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 411970: Some more work on colors and icons for Makefile Editor

This commit is contained in:
Andrew Gvozdev 2013-07-08 11:55:50 -04:00
parent e843235fc4
commit 5ef9a3b925
8 changed files with 18 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

View file

@ -35,7 +35,7 @@ import org.eclipse.swt.graphics.Image;
* and {@link org.eclipse.ui.ide.IDE.SharedImages}.
* </p>
* <p>
* Note that org.eclipse.cdt.ui.tests.misc.MakeUISharedImagesTest will verify
* Note that org.eclipse.cdt.ui.tests.misc.MakeUIImagesTest will verify
* existence of the images defined here.
* </p>
*
@ -45,14 +45,13 @@ import org.eclipse.swt.graphics.Image;
public class MakeUIImages {
// images
public static final String IMG_OBJS_TARGET = "icons/obj16/target_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_TARGET_RULE = "icons/obj16/trule_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_MACRO = "icons/obj16/macro_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_INFERENCE_RULE = "icons/obj16/irule_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_RELATION = "icons/obj16/relation_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_COMMAND = "icons/obj16/command_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_INCLUDE = "icons/obj16/include_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_ENVIRONMENT = "icons/obj16/environment_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_ENV_VAR = "icons/obj16/envvar_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_AUTO_VARIABLE = "icons/obj16/var_auto.png"; //$NON-NLS-1$
public static final String IMG_ETOOL_MAKEFILE = "icons/etool16/makefile.gif"; //$NON-NLS-1$
public static final String IMG_ETOOL_TARGET_BUILD = "icons/etool16/target_build.png"; //$NON-NLS-1$

View file

@ -30,6 +30,7 @@ import org.eclipse.cdt.make.internal.core.makefile.NullMakefile;
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.make.ui.IWorkingCopyManager;
import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@ -160,15 +161,15 @@ public class MakefileContentOutlinePage extends ContentOutlinePage {
@Override
public Image getImage(Object element) {
if (element instanceof ITargetRule) {
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_TARGET_RULE);
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_TARGET);
} else if (element instanceof IInferenceRule) {
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_INFERENCE_RULE);
} else if (element instanceof IMacroDefinition) {
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MACRO);
return CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_VARIABLE);
} else if (element instanceof ICommand) {
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_COMMAND);
} else if (element instanceof IInclude) {
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_INCLUDE);
return MakeUIImages.getImage(MakeUIImages.IMG_ETOOL_MAKEFILE);
} else if (element instanceof IBadDirective) {
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
} else if (element instanceof IParent) {

View file

@ -92,10 +92,9 @@ public class MakefileSourceConfiguration extends TextSourceViewerConfiguration {
assistant.enableAutoActivation(true);
assistant.setAutoActivationDelay(500);
assistant.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
//Set to Carolina blue
assistant.setContextInformationPopupBackground(fColorManager.getColor(new RGB(0, 191, 255)));
assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setContextInformationPopupBackground(fColorManager.getColor(new RGB(255, 255, 255)));
return assistant;
}

View file

@ -18,11 +18,13 @@ import org.eclipse.cdt.make.core.makefile.IDirective;
import org.eclipse.cdt.make.core.makefile.IMacroDefinition;
import org.eclipse.cdt.make.core.makefile.IMakefile;
import org.eclipse.cdt.make.core.makefile.IRule;
import org.eclipse.cdt.make.internal.core.makefile.gnu.AutomaticVariable;
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.make.internal.ui.text.CompletionProposalComparator;
import org.eclipse.cdt.make.internal.ui.text.WordPartDetector;
import org.eclipse.cdt.make.ui.IWorkingCopyManager;
import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.contentassist.CompletionProposal;
@ -87,8 +89,9 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
}
protected IContextInformationValidator fValidator = new Validator();
protected Image imageMacro = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MACRO);
protected Image imageTarget = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_TARGET_RULE);
protected Image imageMacro = CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_VARIABLE);
protected Image imageAutomaticVariable = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_AUTO_VARIABLE);
protected Image imageTarget = MakeUIImages.getImage(MakeUIImages.IMG_OBJS_TARGET);
protected CompletionProposalComparator comparator = new CompletionProposalComparator();
protected IEditorPart fEditor;
@ -126,6 +129,10 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
name = ((IMacroDefinition) statement).getName();
image = imageMacro;
infoString = ((IMacroDefinition)statement).getValue().toString();
} else if (statement instanceof AutomaticVariable) {
name = ((IMacroDefinition) statement).getName();
image = imageAutomaticVariable;
infoString = ((IMacroDefinition)statement).getValue().toString();
} else if (statement instanceof IRule) {
name = ((IRule) statement).getTarget().toString();
image = imageTarget;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 893 B