Skip to content

Commit

Permalink
Merge branch 'master' into improve_overflow_handling_docx#1261
Browse files Browse the repository at this point in the history
  • Loading branch information
hvbtup authored Apr 12, 2023
2 parents 1a6589b + 9037f90 commit bb6a5a6
Show file tree
Hide file tree
Showing 82 changed files with 4,735 additions and 1,278 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ To build BIRT with the latest Eclipse platform, run:
## Eclipse Version
If you want to install BIRT as a plugin, please be aware that BIRT 4.12 requires Eclipse 4.25 and higher

## Latest version 4.12.0
## Latest version 4.13.0
* https://download.eclipse.org/birt/downloads/drops/latest
* https://download.eclipse.org/birt/update-site/latest

## Current version 4.12.0
* https://download.eclipse.org/birt/downloads/drops/R-R1-4.12.0-202211301856/
* https://download.eclipse.org/birt/update-site/4.12.0/
## Current version 4.13.0
* https://download.eclipse.org/birt/downloads/drops/R-R1-4.13.0-202303022006/
* https://download.eclipse.org/birt/update-site/4.13.0/

## Latest snapshots towards 4.13.0
## Latest snapshots towards 4.14.0
* https://download.eclipse.org/birt/downloads/drops/snapshot/
* https://download.eclipse.org/birt/update-site/snapshot/

Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ BordersPage.Tooltip.Left=Left Border
BordersPage.Tooltip.None=None
BordersPage.Tooltip.Right=Right Border
BordersPage.Tooltip.Top=Top Border
BordersPage.Tooltip.Diagonal=Diagonal
BordersPage.Tooltip.Antidiagonal=Antidiagonal
BordersPage.text.Preview=Preview:
BordersPage.Trans.SelectBorder=Select Border
BordersPage.Trans.UnSelectBorder=Unselect Border
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ public static void refreshBorderData(int[] data, int style, int width, int color
* always lose; then compare the width, greater win; if width is equal, compare
* the style, less win; or keep the original. This is the part 1 of the
* algorithm.
*
* @param data border data array
* @param style border style of cell
* @param width border width of cell
* @param color border color of cell
* @param rowIndex row index cell
* @param colIndex column index of cell
* @param type 0, 1 type of bottom-, top-attribute from row or cell (0: row,
* 1: cell)
*/
public static void refreshBorderData(int[] data, int style, int width, int color, int rowIndex, int colIndex,
int type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;

public class ReportMultiBookPage extends Page implements IContentOutlinePage, ISelectionChangedListener {
public class ReportMultiBookPage extends Page implements PalettePage, IContentOutlinePage, ISelectionChangedListener {

private PageBook pagebook;
private ISelection selection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@

package org.eclipse.birt.report.designer.internal.ui.views.attributes.page;

import java.util.List;

import org.eclipse.birt.report.designer.internal.ui.views.attributes.provider.BorderColorDescriptorProvider;
import org.eclipse.birt.report.designer.internal.ui.views.attributes.provider.BorderStyleDescriptorProvider;
import org.eclipse.birt.report.designer.internal.ui.views.attributes.provider.BorderToggleDescriptorProvider;
import org.eclipse.birt.report.designer.internal.ui.views.attributes.provider.BorderWidthDescriptorProvider;
import org.eclipse.birt.report.designer.internal.ui.views.attributes.section.BorderSection;
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.birt.report.model.api.StyleHandle;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
import org.eclipse.birt.report.model.elements.interfaces.IStyleModel;
import org.eclipse.swt.widgets.Composite;

/**
Expand All @@ -41,7 +44,7 @@ public class BordersPage extends ResetAttributePage {
@Override
public void buildUI(Composite parent) {
super.buildUI(parent);
container.setLayout(WidgetUtil.createGridLayout(1, 15));
container.setLayout(org.eclipse.birt.report.designer.internal.ui.util.WidgetUtil.createGridLayout(1, 15));

// BorderStyleDescriptorProvider styleProvider = new
// BorderStyleDescriptorProvider( );
Expand Down Expand Up @@ -86,18 +89,25 @@ public void buildUI(Composite parent) {
// BorderDescriptorProvider[]{
// styleProvider, colorProvider, widthProvider
// };
//
providers = new BorderToggleDescriptorProvider[] {
new BorderToggleDescriptorProvider(StyleHandle.BORDER_TOP_STYLE_PROP),
new BorderToggleDescriptorProvider(StyleHandle.BORDER_BOTTOM_STYLE_PROP),
new BorderToggleDescriptorProvider(StyleHandle.BORDER_LEFT_STYLE_PROP),
new BorderToggleDescriptorProvider(StyleHandle.BORDER_RIGHT_STYLE_PROP) };
//
// TogglesSection borderSection = new TogglesSection( container,
// LABEL_BORDER );
// borderSection.setProviders( providers );
// borderSection.setGridPlaceholder( 4, true );
// addSection( PageSectionId.BORDERS_BORDER_STYLE, borderSection );

// diagonal and antidiagonal buttons only added on cell object (cell handle)
if (input != null && ((List<?>) input).size() >= 1 && ((List<?>) input).get(0) instanceof CellHandle) {
providers = new BorderToggleDescriptorProvider[] {
new BorderToggleDescriptorProvider(IStyleModel.BORDER_TOP_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_BOTTOM_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_LEFT_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_RIGHT_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_DIAGONAL_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_ANTIDIAGONAL_STYLE_PROP)
};

} else {
providers = new BorderToggleDescriptorProvider[] {
new BorderToggleDescriptorProvider(IStyleModel.BORDER_TOP_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_BOTTOM_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_LEFT_STYLE_PROP),
new BorderToggleDescriptorProvider(IStyleModel.BORDER_RIGHT_STYLE_PROP) };
}

borderSection = new BorderSection(LABEL_BORDER, container, true);
BorderStyleDescriptorProvider styleProvider = new BorderStyleDescriptorProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
import org.eclipse.birt.report.model.api.metadata.IChoiceSet;
import org.eclipse.birt.report.model.elements.interfaces.IStyleModel;

public class BorderColorDescriptorProvider extends BorderDescriptorProvider {

Expand All @@ -40,28 +41,42 @@ public String getDisplayName() {

@Override
public Object load() {
String value = getLocalStringValue(StyleHandle.BORDER_LEFT_COLOR_PROP);
String value = getLocalStringValue(IStyleModel.BORDER_LEFT_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
return value;
}

value = getLocalStringValue(StyleHandle.BORDER_RIGHT_COLOR_PROP);
value = getLocalStringValue(IStyleModel.BORDER_RIGHT_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
return value;
}

value = getLocalStringValue(StyleHandle.BORDER_TOP_COLOR_PROP);
value = getLocalStringValue(IStyleModel.BORDER_TOP_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
return value;
}

value = getLocalStringValue(StyleHandle.BORDER_BOTTOM_COLOR_PROP);
value = getLocalStringValue(IStyleModel.BORDER_BOTTOM_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
return value;
}

value = getLocalStringValue(IStyleModel.BORDER_DIAGONAL_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
return value;
}

value = getLocalStringValue(IStyleModel.BORDER_ANTIDIAGONAL_COLOR_PROP);
if (!"".equals(value)) //$NON-NLS-1$
{
this.indexText = value;
Expand All @@ -79,28 +94,40 @@ public void setIndex(Object index) {
@Override
public void save(Object value) throws SemanticException {
this.indexText = value == null ? "" : value; //$NON-NLS-1$
if (((Boolean) styleMap.get(StyleHandle.BORDER_TOP_STYLE_PROP)).booleanValue()) {
save(StyleHandle.BORDER_TOP_COLOR_PROP, value);
if ((styleMap.get(IStyleModel.BORDER_TOP_STYLE_PROP)).booleanValue()) {
save(IStyleModel.BORDER_TOP_COLOR_PROP, value);
} else {
save(IStyleModel.BORDER_TOP_COLOR_PROP, null);
}

if ((styleMap.get(IStyleModel.BORDER_BOTTOM_STYLE_PROP)).booleanValue()) {
save(IStyleModel.BORDER_BOTTOM_COLOR_PROP, value);
} else {
save(IStyleModel.BORDER_BOTTOM_COLOR_PROP, null);
}

if ((styleMap.get(IStyleModel.BORDER_LEFT_STYLE_PROP)).booleanValue()) {
save(IStyleModel.BORDER_LEFT_COLOR_PROP, value);
} else {
save(StyleHandle.BORDER_TOP_COLOR_PROP, null);
save(IStyleModel.BORDER_LEFT_COLOR_PROP, null);
}

if (((Boolean) styleMap.get(StyleHandle.BORDER_BOTTOM_STYLE_PROP)).booleanValue()) {
save(StyleHandle.BORDER_BOTTOM_COLOR_PROP, value);
if ((styleMap.get(IStyleModel.BORDER_RIGHT_STYLE_PROP)).booleanValue()) {
save(IStyleModel.BORDER_RIGHT_COLOR_PROP, value);
} else {
save(StyleHandle.BORDER_BOTTOM_COLOR_PROP, null);
save(IStyleModel.BORDER_RIGHT_COLOR_PROP, null);
}

if (((Boolean) styleMap.get(StyleHandle.BORDER_LEFT_STYLE_PROP)).booleanValue()) {
save(StyleHandle.BORDER_LEFT_COLOR_PROP, value);
if ((styleMap.get(IStyleModel.BORDER_DIAGONAL_STYLE_PROP)).booleanValue()) {
save(IStyleModel.BORDER_DIAGONAL_COLOR_PROP, value);
} else {
save(StyleHandle.BORDER_LEFT_COLOR_PROP, null);
save(IStyleModel.BORDER_DIAGONAL_COLOR_PROP, null);
}

if (((Boolean) styleMap.get(StyleHandle.BORDER_RIGHT_STYLE_PROP)).booleanValue()) {
save(StyleHandle.BORDER_RIGHT_COLOR_PROP, value);
if (styleMap.get(IStyleModel.BORDER_ANTIDIAGONAL_STYLE_PROP).booleanValue()) {
save(IStyleModel.BORDER_ANTIDIAGONAL_COLOR_PROP, value);
} else {
save(StyleHandle.BORDER_RIGHT_COLOR_PROP, null);
save(IStyleModel.BORDER_ANTIDIAGONAL_COLOR_PROP, null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@
import org.eclipse.birt.report.designer.util.DEUtil;
import org.eclipse.birt.report.model.api.GroupElementHandle;
import org.eclipse.birt.report.model.api.GroupPropertyHandle;
import org.eclipse.birt.report.model.api.StyleHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.elements.interfaces.IStyleModel;

public abstract class BorderDescriptorProvider extends AbstractDescriptorProvider {

protected Object input;

protected HashMap styleMap = new HashMap();
protected HashMap<String, Boolean> styleMap = new HashMap();

public BorderDescriptorProvider() {
styleMap.put(StyleHandle.BORDER_LEFT_STYLE_PROP, Boolean.FALSE);
styleMap.put(StyleHandle.BORDER_RIGHT_STYLE_PROP, Boolean.FALSE);
styleMap.put(StyleHandle.BORDER_TOP_STYLE_PROP, Boolean.FALSE);
styleMap.put(StyleHandle.BORDER_BOTTOM_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_LEFT_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_RIGHT_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_TOP_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_BOTTOM_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_DIAGONAL_STYLE_PROP, Boolean.FALSE);
styleMap.put(IStyleModel.BORDER_ANTIDIAGONAL_STYLE_PROP, Boolean.FALSE);
}

public void setStyleProperty(String style, Boolean value) {
Expand All @@ -47,7 +49,7 @@ public void setInput(Object input) {
protected String getLocalStringValue(String property) {
GroupElementHandle handle = null;
if (input instanceof List) {
handle = DEUtil.getGroupElementHandle((List) input);
handle = DEUtil.getGroupElementHandle((List<?>) input);
}
if (handle == null) {
return ""; //$NON-NLS-1$
Expand All @@ -64,7 +66,7 @@ protected String getLocalStringValue(String property) {
protected String getStringValue(String property) {
GroupElementHandle handle = null;
if (input instanceof List) {
handle = DEUtil.getGroupElementHandle((List) input);
handle = DEUtil.getGroupElementHandle((List<?>) input);
}
if (handle == null) {
return ""; //$NON-NLS-1$
Expand All @@ -81,26 +83,28 @@ protected String getStringValue(String property) {
protected String getDisplayValue(String property) {
GroupElementHandle handle = null;
if (input instanceof List) {
handle = DEUtil.getGroupElementHandle((List) input);
handle = DEUtil.getGroupElementHandle((List<?>) input);
}
if (handle == null) {
return ""; //$NON-NLS-1$
}
if (getLocalStringValue(property).equals("")) {
String value = handle.getPropertyHandle(property).getStringValue();
if (value == null) {
value = ""; //$NON-NLS-1$
String value = "";
if (handle.getPropertyHandle(property) != null) {
value = handle.getPropertyHandle(property).getStringValue();
if (value == null) {
value = ""; //$NON-NLS-1$
}
}
return value;
} else {
return ""; //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
}

protected String getDefaultStringValue(String property) {
GroupElementHandle handle = null;
if (input instanceof List) {
handle = DEUtil.getGroupElementHandle((List) input);
handle = DEUtil.getGroupElementHandle((List<?>) input);
}
if (handle == null) {
return ""; //$NON-NLS-1$
Expand All @@ -113,9 +117,8 @@ protected String getDefaultStringValue(String property) {
value = ""; //$NON-NLS-1$
}
return value;
} else {
return ""; //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
}

protected void save(String property, Object value) throws SemanticException {
Expand All @@ -124,7 +127,7 @@ protected void save(String property, Object value) throws SemanticException {
if (input instanceof GroupElementHandle) {
groupElementHandle = (GroupElementHandle) input;
} else if (input instanceof List) {
groupElementHandle = DEUtil.getGroupElementHandle((List) input);
groupElementHandle = DEUtil.getGroupElementHandle((List<?>) input);
}

if (groupElementHandle != null) {
Expand Down
Loading

0 comments on commit bb6a5a6

Please sign in to comment.