-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accommodate external binary object files
- Adorn external binary object icons - Present symbols under external binary object resources - Label external binary objects with filename only - Present absent external binary objects with grey label - Sort external binary objects by filename only
- Loading branch information
Showing
11 changed files
with
213 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/BinaryFileDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 John Dallaway and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* John Dallaway - initial implementation (#630) | ||
*******************************************************************************/ | ||
package org.eclipse.cdt.internal.ui.viewsupport; | ||
|
||
import org.eclipse.cdt.core.model.IBinary; | ||
import org.eclipse.jface.preference.JFacePreferences; | ||
import org.eclipse.jface.resource.JFaceResources; | ||
import org.eclipse.jface.viewers.BaseLabelProvider; | ||
import org.eclipse.jface.viewers.IDecoration; | ||
import org.eclipse.jface.viewers.ILightweightLabelDecorator; | ||
import org.eclipse.swt.graphics.Color; | ||
|
||
/** | ||
* Decorates binary files including executable, object, core and library files | ||
*/ | ||
public final class BinaryFileDecorator extends BaseLabelProvider implements ILightweightLabelDecorator { | ||
|
||
@Override | ||
public boolean isLabelProperty(Object element, String property) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void decorate(Object element, IDecoration decoration) { | ||
// if a binary file that is not present locally | ||
if (element instanceof IBinary binary && !binary.exists()) { | ||
// decorate label to indicate file is absent | ||
Color color = JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR); | ||
decoration.setForegroundColor(color); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.