Skip to content

Commit

Permalink
Release 3.7.5.201709290120
Browse files Browse the repository at this point in the history
  • Loading branch information
frankshaka committed Oct 19, 2017
1 parent b9c27ea commit 4e8bfb9
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ private void createTitleSection(Composite parent) {

FontData[] fontData = Display.getDefault().getSystemFont()
.getFontData();
titleLabel.setFont((Font) resources.get(FontDescriptor.createFrom(
FontUtils.bold((FontUtils.newHeight(fontData, 30)), true))));
titleLabel.setFont(
(Font) resources.get(FontDescriptor.createFrom(FontUtils.bold(
(FontUtils.relativeHeight(fontData, 21)), true))));
titleLabel.setText(WorkbenchMessages.WelcomDialog_Welcom_title);

Label title2 = new Label(composite, SWT.BOTTOM);
Expand All @@ -274,8 +275,8 @@ private void createTitleSection(Composite parent) {
GridData layoutData = new GridData(SWT.CENTER, SWT.BOTTOM, false, true);
title2.setLayoutData(layoutData);

title2.setFont((Font) resources.get(
FontDescriptor.createFrom(FontUtils.newHeight(fontData, 15))));
title2.setFont((Font) resources.get(FontDescriptor
.createFrom(FontUtils.relativeHeight(fontData, 6))));
title2.setText(WorkbenchMessages.WelcomDialog_WhatIsNew_title);

// Label imageLabel = new Label(composite, SWT.CENTER);
Expand Down Expand Up @@ -431,7 +432,7 @@ public void mouseDown(MouseEvent e) {
new GridData(SWT.CENTER, SWT.CENTER, true, false));
titleLabel.setText(title);
titleLabel.setFont((Font) resources.get(FontDescriptor.createFrom(
FontUtils.bold(FontUtils.newHeight(fontData, 11), true))));
FontUtils.bold(FontUtils.relativeHeight(fontData, 2), true))));

Label descriptionLabel = new Label(composite2, SWT.WRAP);
descriptionLabel.setBackground(composite2.getBackground());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,17 @@ public static IWorkbookRef saveWorkbookAs(ISaveContext context,
/// sort by priority
/// choose highest priority
/// exclude those whose priority < 0
int priority = wizardDescriptor.getWizard()
.getPriorityFor(context, options);
if (priority > maxPriority) {
maxPriority = priority;
defaultWizard = wizardDescriptor;
ISaveWizard wizard_0 = wizardDescriptor.getWizard();
if (wizard_0 != null) {
int priority = wizard_0.getPriorityFor(context,
options);
if (priority > maxPriority) {
maxPriority = priority;
defaultWizard = wizardDescriptor;
}
if (priority < 0)
wizards.remove(wizardDescriptor);
}
if (priority < 0)
wizards.remove(wizardDescriptor);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
Expand Down Expand Up @@ -103,8 +104,18 @@ public static String getAbsolutePath(Object context, String path) {
}

private static URI getFileURIFrom(IWorkbook workbook) {
IWorkbenchPage[] pages = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getPages();
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window == null) {
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
if (windows != null && windows.length != 0) {
window = windows[0];
}
}
if (window == null) {
return null;
}
IWorkbenchPage[] pages = window.getPages();
for (IWorkbenchPage wp : pages) {
IEditorReference[] ers = wp.getEditorReferences();
for (IEditorReference er : ers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
Expand All @@ -68,7 +70,8 @@
/**
* @author Frank Shaka
*/
public class ColorPicker extends ContributionItem implements ISelectionProvider {
public class ColorPicker extends ContributionItem
implements ISelectionProvider {

private final class ColorChooserPopupDialog extends PopupDialog {

Expand All @@ -87,8 +90,8 @@ protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridLayoutFactory layout = GridLayoutFactory.fillDefaults()
.spacing(0, 0);
GridDataFactory layoutData = GridDataFactory.fillDefaults().grab(
true, false);
GridDataFactory layoutData = GridDataFactory.fillDefaults()
.grab(true, false);
layout.copy().margins(4, 4).applyTo(composite);

if (viewer == null) {
Expand All @@ -106,7 +109,8 @@ protected RGB openNativeColorDialog(Shell shell,
viewer.setShowAutoItem(hasPopupStyle(AUTO));
viewer.setShowNoneItem(hasPopupStyle(NONE));
viewer.setShowCustomItem(hasPopupStyle(CUSTOM));
viewer.addSelectionChangedListener(viewerSelectionChangedListener);
viewer.addSelectionChangedListener(
viewerSelectionChangedListener);
viewer.addOpenListener(viewerOpenListener);
}
viewer.createControl(composite);
Expand Down Expand Up @@ -392,7 +396,8 @@ public void setSelection(ISelection selection) {
fireSelectionChanged(new SelectionChangedEvent(this, getSelection()));
}

public void addSelectionChangedListener(ISelectionChangedListener listener) {
public void addSelectionChangedListener(
ISelectionChangedListener listener) {
if (selectionChangedListeners == null)
selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
selectionChangedListeners.add(listener);
Expand Down Expand Up @@ -464,8 +469,16 @@ public void open() {
protected ColorChooserPopupDialog getPopupDialog() {
if (popup == null) {
Shell shell = getShell();
if (shell != null)
if (shell != null) {
popup = new ColorChooserPopupDialog(shell);
popup.getShell().addDisposeListener(new DisposeListener() {

@Override
public void widgetDisposed(DisposeEvent e) {
popup = null;
}
});
}
}
return popup;
}
Expand All @@ -477,6 +490,8 @@ private Shell getShell() {
return ((MenuItem) widget).getParent().getShell();
} else if (widget instanceof Control) {
return ((Control) widget).getShell();
} else if (Display.getCurrent() != null) {
return Display.getCurrent().getActiveShell();
}
return null;
}
Expand All @@ -501,9 +516,8 @@ private Rectangle getItemBoundsToDisplay(ToolItem item) {
* <code>ToolItem</code> for the action using the action's style. If the
* action's checked property has been set, a button is created and primed to
* the value of the checked property. If the action's menu creator property
* has been set, a drop-down tool item is created.
*
* ATTN: Brian Sun has modified this method!
* has been set, a drop-down tool item is created. ATTN: Brian Sun has
* modified this method!
*/
public void fill(ToolBar parent, int index) {
if (widget == null && parent != null) {
Expand Down Expand Up @@ -696,7 +710,6 @@ public IAction getAction() {
* tool items, the text is shown only if there is no image.
*
* @return the presentation mode settings
*
* @since 3.0
*/
public int getMode() {
Expand Down Expand Up @@ -800,7 +813,6 @@ public boolean isEnabled() {
*
* @param mode
* the presentation mode settings
*
* @since 3.0
*/
public void setMode(int mode) {
Expand Down Expand Up @@ -931,13 +943,12 @@ public void update(String propertyName) {
boolean tooltipTextChanged = propertyName == null
|| propertyName.equals(IAction.TOOL_TIP_TEXT);
boolean enableStateChanged = propertyName == null
|| propertyName.equals(IAction.ENABLED)
|| propertyName
|| propertyName.equals(IAction.ENABLED) || propertyName
.equals(IContributionManagerOverrides.P_ENABLED);
boolean checkChanged = (action.getStyle() == IAction.AS_CHECK_BOX || action
.getStyle() == IAction.AS_RADIO_BUTTON)
&& (propertyName == null || propertyName
.equals(IAction.CHECKED));
boolean checkChanged = (action.getStyle() == IAction.AS_CHECK_BOX
|| action.getStyle() == IAction.AS_RADIO_BUTTON)
&& (propertyName == null
|| propertyName.equals(IAction.CHECKED));
boolean colorChanged = propertyName == null
|| propertyName.equals(IColorAction.COLOR);

Expand All @@ -948,7 +959,8 @@ public void update(String propertyName) {
String text = action.getText();
// the set text is shown only if there is no image or if forced by MODE_FORCE_TEXT
boolean showText = text != null
&& ((getMode() & MODE_FORCE_TEXT) != 0 || !hasImages(action));
&& ((getMode() & MODE_FORCE_TEXT) != 0
|| !hasImages(action));
// && ((toolbarStyle & BFaceConstants.TOOLBAR_TEXT)!=0 ||
// ((toolbarStyle & BFaceConstants.TOOLBAR_TEXT_RIGHT)!=0 && hasRightText));

Expand All @@ -960,7 +972,8 @@ public void update(String propertyName) {

if (textChanged) {
String textToSet = showText ? text : ""; //$NON-NLS-1$
boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0;
boolean rightStyle = (ti.getParent().getStyle()
& SWT.RIGHT) != 0;
if (rightStyle || !ti.getText().equals(textToSet)) {
// In addition to being required to update the text if it
// gets nulled out in the action, this is also a workaround
Expand Down Expand Up @@ -1038,7 +1051,8 @@ public void update(String propertyName) {
*/
final String commandId = updatedAction
.getActionDefinitionId();
if (("gtk".equals(SWT.getPlatform())) && (callback instanceof IBindingManagerCallback) //$NON-NLS-1$
if (("gtk".equals(SWT.getPlatform())) //$NON-NLS-1$
&& (callback instanceof IBindingManagerCallback)
&& (commandId != null)) {
final IBindingManagerCallback bindingManagerCallback = (IBindingManagerCallback) callback;
final IKeyLookup lookup = KeyLookupFactory.getDefault();
Expand All @@ -1054,10 +1068,15 @@ public void update(String propertyName) {
final KeyStroke currentKeyStroke = (KeyStroke) trigger;
final int currentNaturalKey = currentKeyStroke
.getNaturalKey();
if ((currentKeyStroke.getModifierKeys() == (lookup
.getCtrl() | lookup.getShift()))
&& ((currentNaturalKey >= '0' && currentNaturalKey <= '9')
|| (currentNaturalKey >= 'A' && currentNaturalKey <= 'F') || (currentNaturalKey == 'U'))) {
if ((currentKeyStroke
.getModifierKeys() == (lookup
.getCtrl()
| lookup.getShift()))
&& ((currentNaturalKey >= '0'
&& currentNaturalKey <= '9')
|| (currentNaturalKey >= 'A'
&& currentNaturalKey <= 'F')
|| (currentNaturalKey == 'U'))) {
accelerator = currentKeyStroke
.getModifierKeys()
| currentNaturalKey;
Expand Down Expand Up @@ -1224,10 +1243,9 @@ private boolean updateImages(boolean forceImage) {
parentResourceManager);

// performance: more efficient in SWT to set disabled and hot image before regular image
((ToolItem) widget)
.setDisabledImage(disabledImage == null ? null
: localManager
.createImageWithDefault(disabledImage));
((ToolItem) widget).setDisabledImage(disabledImage == null
? null
: localManager.createImageWithDefault(disabledImage));
((ToolItem) widget).setImage(image == null ? null
: localManager.createImageWithDefault(image));

Expand Down Expand Up @@ -1269,8 +1287,8 @@ private boolean updateImages(boolean forceImage) {
: localManager.createImageWithDefault(disabledImage));
((ToolItem) widget).setHotImage(hoverImage == null ? null
: localManager.createImageWithDefault(hoverImage));
((ToolItem) widget).setImage(image == null ? null : localManager
.createImageWithDefault(image));
((ToolItem) widget).setImage(image == null ? null
: localManager.createImageWithDefault(image));

// Now that we're no longer referencing the old images, clear them out.
disposeOldImages();
Expand All @@ -1294,11 +1312,11 @@ private boolean updateImages(boolean forceImage) {
parentResourceManager);

if (widget instanceof Item) {
((Item) widget).setImage(image == null ? null : localManager
.createImageWithDefault(image));
((Item) widget).setImage(image == null ? null
: localManager.createImageWithDefault(image));
} else if (widget instanceof Button) {
((Button) widget).setImage(image == null ? null : localManager
.createImageWithDefault(image));
((Button) widget).setImage(image == null ? null
: localManager.createImageWithDefault(image));
}

// Now that we're no longer referencing the old images, clear them out.
Expand All @@ -1320,4 +1338,4 @@ private void disposeOldImages() {
}
}

}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.xmind.releng</groupId>
<artifactId>org.xmind.cathy.releng</artifactId>
<version>3.7.3-SNAPSHOT</version>
<version>3.7.5-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down

0 comments on commit 4e8bfb9

Please sign in to comment.