Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mw accessible overlay #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ private void removeAllChildren() {
}

/**
* Return the operation that triggered the other operations in this
* composite.
* Return the operation that triggered the other operations in this composite.
*
* @return the IUndoableOperation that triggered the other children.
* @return the IUndoableOperation that triggered the other children or
* <code>null</code> if the triggeringOperation was removed
* @see TriggeredOperations#remove(IUndoableOperation)
*/
public IUndoableOperation getTriggeringOperation() {
return triggeringOperation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.ui.workbench.addons.swt;singleton:=true
Bundle-Version: 1.5.400.qualifier
Bundle-Version: 1.5.500.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public static MWindow getWindowFor(MUIElement element) {
// null since it's not in the 'children' hierarchy
while (parent != null && !(parent instanceof MWindow)) {
if (parent.getTags().contains(MIN_MAXIMIZEABLE_CHILDREN_AREA_TAG) && parent instanceof MArea) {
parent = ((MArea) parent).getCurSharedRef();
parent = parent.getCurSharedRef();
} else {
parent = parent.getParent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private String getToolTipText(boolean attachKeybinding) {

private String legacyActionLabelSupport(String text, ParameterizedCommand command) {

return java.util.Optional.of(command).map(ParameterizedCommand::getCommand).map(Command::getHandler)
return java.util.Optional.ofNullable(command).map(ParameterizedCommand::getCommand).map(Command::getHandler)
.map(IHandler::getHandlerLabel).filter(Objects::nonNull).orElse(text);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected void layout(Composite composite, boolean flushCache) {

Rectangle bounds = composite.getBounds();
if (composite instanceof Shell)
bounds = ((Shell) composite).getClientArea();
bounds = composite.getClientArea();
else {
bounds.x = 0;
bounds.y = 0;
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.e4.ui.workbench/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.ui.workbench;singleton:=true
Bundle-Version: 1.15.400.qualifier
Bundle-Version: 1.15.500.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.eclipse.e4.core.services.translation.TranslationService;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.MElementContainer;
import org.eclipse.e4.ui.model.application.ui.MLocalizable;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
Expand Down Expand Up @@ -142,7 +141,7 @@ protected void updateLocalization(List<? extends MUIElement> children) {
}
}

((MLocalizable) element).updateLocalization();
element.updateLocalization();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
*/
package org.eclipse.jface.text.source.inlined;

import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
Expand All @@ -27,6 +24,10 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;

import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy;

/**
* {@link IDrawingStrategy} implementation to render {@link AbstractInlinedAnnotation}.
*
Expand Down Expand Up @@ -115,7 +116,7 @@ private boolean match(Font annotationFont, StyledText widget) {
}
int widgetFontHeight = widget.getFont().getFontData()[0].getHeight();
int annotationFontHeight = annotationFont.getFontData()[0].getHeight();
return annotationFontHeight == widgetFontHeight;
return annotationFontHeight == widgetFontHeight;
}

/**
Expand Down Expand Up @@ -201,7 +202,7 @@ private static void draw(LineHeaderAnnotation annotation, GC gc, StyledText text
*/
private static void draw(LineContentAnnotation annotation, GC gc, StyledText textWidget, int widgetOffset, int length,
Color color) {
if (annotation.isEndOfLine(widgetOffset, textWidget)) {
if (annotation.isEmptyLine(widgetOffset, textWidget)) {
drawAfterLine(annotation, gc, textWidget, widgetOffset, length, color);
} else if (LineContentAnnotation.drawRightToPreviousChar(widgetOffset, textWidget)) {
drawAsRightOfPreviousCharacter(annotation, gc, textWidget, widgetOffset, length, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
*/
package org.eclipse.jface.text.source.inlined;

import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.GlyphMetrics;

import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.source.ISourceViewer;

/**
* Inlined annotation which is drawn in the line content and which takes some place with a given
* width.
Expand Down Expand Up @@ -162,14 +163,12 @@ static boolean drawRightToPreviousChar(int widgetOffset, StyledText textWidget)
textWidget.getLineAtOffset(widgetOffset) == textWidget.getLineAtOffset(widgetOffset - 1);
}

boolean isEndOfLine(int widgetOffset, StyledText text) {
boolean isEmptyLine(int widgetOffset, StyledText text) {
if (text.getCharCount() <= widgetOffset) { // Assuming widgetOffset >= 0
return true;
}
int line= text.getLineAtOffset(widgetOffset);
int startOfLine= text.getOffsetAtLine(line);
int offsetInLine= widgetOffset - startOfLine;
return offsetInLine >= text.getLine(line).length();
String lineStr= text.getLine(line);
return lineStr.length() == 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ private boolean createColumnObjects() {

private Image getColumnImage(Item item) {
if (item instanceof TableColumn) {
return ((TableColumn) item).getImage();
return item.getImage();
} else if (item instanceof TreeColumn) {
return ((TreeColumn) item).getImage();
return item.getImage();
}
return null;
}
Expand Down Expand Up @@ -301,12 +301,12 @@ private void createLabel(final Composite composite, String string) {
private String getColumnName(Item item) {
String result = ""; //$NON-NLS-1$
if (item instanceof TableColumn) {
result = ((TableColumn) item).getText();
result = item.getText();
if (result.trim().isEmpty()) {
result = ((TableColumn) item).getToolTipText();
}
} else if (item instanceof TreeColumn) {
result = ((TreeColumn) item).getText();
result = item.getText();
if (result.trim().isEmpty()) {
result = ((TreeColumn) item).getToolTipText();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.core.refactoring
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ltk.core.refactoring; singleton:=true
Bundle-Version: 3.14.400.qualifier
Bundle-Version: 3.14.500.qualifier
Bundle-Activator: org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ private static void disableParticipant(final RefactoringParticipant participant,

private void addToTextChangeMap(Change change) {
if (change instanceof TextChange) {
Object element= ((TextChange) change).getModifiedElement();
Object element= change.getModifiedElement();
if (element != null) {
fTextChangeMap.put(element, (TextChange) change);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ public void changePerformed(Change change, boolean successful) {
@Override
public void addUndo(String name, Change change) {
if (fActiveOperation != null) {
UndoableOperation2ChangeAdapter operation= (UndoableOperation2ChangeAdapter)fActiveOperation.getTriggeringOperation();
operation.setUndoChange(change);
operation.setLabel(name);
if (fActiveOperation.getTriggeringOperation() instanceof UndoableOperation2ChangeAdapter operation) {
operation.setUndoChange(change);
operation.setLabel(name);
}
fOperationHistory.add(fActiveOperation);
fActiveOperation= null;
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.search/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.search; singleton:=true
Bundle-Version: 3.16.200.qualifier
Bundle-Version: 3.16.300.qualifier
Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;

import org.eclipse.jface.dialogs.IDialogSettings;
Expand Down Expand Up @@ -336,7 +335,7 @@ public int computeScore(Object element) {

IResource resource= ((IAdaptable)element).getAdapter(IResource.class);
if (resource != null && resource.getType() == IResource.FILE) {
String extension= ((IFile)resource).getFileExtension();
String extension= resource.getFileExtension();
if (extension != null)
score= Math.max(score, getScoreForFileExtension(extension));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ private boolean ensureQuickDiffProvider(String diffProviderId) {
modelExtension.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, newDiffer);

if (fDelegate instanceof IChangeRulerColumn)
((IChangeRulerColumn) fDelegate).setModel(annotationModel); // picks up the new model attachment
fDelegate.setModel(annotationModel); // picks up the new model attachment

return true;
}
Expand All @@ -543,7 +543,7 @@ private boolean ensureQuickDiffProvider(String diffProviderId) {
private void installChangeRulerModel(IVerticalRulerColumn column) {
if (column instanceof IChangeRulerColumn) {
IAnnotationModel model= getAnnotationModelWithDiffer();
((IChangeRulerColumn) column).setModel(model);
column.setModel(model);
if (model != null) {
ISourceViewer viewer= fViewer;
if (viewer != null && viewer.getAnnotationModel() == null && column.getControl() != null)
Expand All @@ -559,7 +559,7 @@ private void installChangeRulerModel(IVerticalRulerColumn column) {
*/
private void uninstallChangeRulerModel(IVerticalRulerColumn column) {
if (column instanceof IChangeRulerColumn)
((IChangeRulerColumn) column).setModel(null);
column.setModel(null);
IAnnotationModel model= getDiffer();
if (model instanceof ILineDifferExtension)
((ILineDifferExtension) model).suspend();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ protected IResource getResource() {
ITextEditor editor= getTextEditor();
if (editor != null) {
IEditorInput input= editor.getEditorInput();
return ((IAdaptable) input).getAdapter(IResource.class);
return input.getAdapter(IResource.class);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private boolean promptForConfirmation() {
IResource firstSelected = selection.get(0);
String projectName = null;
if (firstSelected instanceof IProject) {
projectName = ((IProject) firstSelected).getName();
projectName = firstSelected.getName();
}
message = NLS.bind(IDEWorkbenchMessages.CloseUnrelatedProjectsAction_confirmMsg1, projectName);
} else // if more then one project is selected then print there number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ protected boolean updateSelection(IStructuredSelection selection) {
if (selectedResources.isEmpty()) {
return false;
}
IContainer firstParent = ((IResource) selectedResources.get(0))
IContainer firstParent = selectedResources.get(0)
.getParent();
if (firstParent == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui.navigator.resources; singleton:=true
Bundle-Version: 3.9.300.qualifier
Bundle-Version: 3.9.400.qualifier
Bundle-Activator: org.eclipse.ui.internal.navigator.resources.plugin.WorkbenchNavigatorPlugin
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private IContainer getContainer(IResource[] clipboardContent) {
}

if (selection.get(0) instanceof IFile) {
return ((IFile) selection.get(0)).getParent();
return selection.get(0).getParent();
}
return (IContainer) selection.get(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ public void fillContextMenu(IMenuManager menu) {
buildAction.selectionChanged(selection);
menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, buildAction);
}
// To refresh, even if one project is open
if (hasOpenProjects) {
// Add the 'refresh' item if any selection is either (a) an open project, or (b)
// a non-project selection (so the 'refresh' item is not shown if all selections
// are closed projects)
if (hasOpenProjects || !isProjectSelection) {
refreshAction.selectionChanged(selection);
menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, refreshAction);
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui.navigator; singleton:=true
Bundle-Version: 3.12.400.qualifier
Bundle-Version: 3.12.500.qualifier
Bundle-Activator: org.eclipse.ui.internal.navigator.NavigatorPlugin
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private boolean callNormalHasChildren(Object anElementOrPath, Object anElement,
ITreePathContentProvider tpcp = cp;
return tpcp.hasChildren((TreePath) anElementOrPath);
}
return ((ITreeContentProvider) cp).hasChildren(anElement);
return cp.hasChildren(anElement);
}

private boolean pipelineHasChildren(Object anElementOrPath, Object anElement,
Expand Down Expand Up @@ -632,8 +632,8 @@ public void run() throws Exception {

if (!isOverridingDescriptorInSet(foundExtension.getDescriptor(), descriptors)) {
if (foundExtension.internalGetContentProvider().isTreePath()) {
TreePath[] parentTreePaths = ((ITreePathContentProvider) foundExtension
.internalGetContentProvider()).getParents(anElement);
TreePath[] parentTreePaths = foundExtension
.internalGetContentProvider().getParents(anElement);

for (TreePath parentTreePath : parentTreePaths) {

Expand Down
Loading