Skip to content

Commit

Permalink
BIRT 1388: Incorrect wording in context menu to create a new master page
Browse files Browse the repository at this point in the history
Signed-off-by: Shijie Zhang <szhang@opentext.com>
  • Loading branch information
Shijie Zhang committed Nov 18, 2015
1 parent 3de3603 commit 7077fc3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -2287,6 +2287,7 @@ InputParameterDialog.boolean.checked=Yes
#InsertAction properties

InsertAction.text=I&nsert Element
NewMasterPage.text=&New master page

###########################################################
#InsertColumnAction properties
Expand Down
Expand Up @@ -27,7 +27,9 @@
import org.eclipse.birt.report.model.api.ListingHandle;
import org.eclipse.birt.report.model.api.PropertyHandle;
import org.eclipse.birt.report.model.api.SlotHandle;
import org.eclipse.birt.report.model.api.core.IModuleModel;
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.elements.interfaces.IListingElementModel;
import org.eclipse.gef.Request;

Expand All @@ -46,7 +48,9 @@ public class InsertAction extends AbstractElementAction

public final static String CURRENT = "current"; //$NON-NLS-1$

private final static String TEXT = Messages.getString( "InsertAction.text" ); //$NON-NLS-1$
private final static String INSERT_TEXT = Messages.getString( "InsertAction.text" ); //$NON-NLS-1$

private final static String NEW_MASTER_PAGE_TEXT = Messages.getString( "NewMasterPage.text" );

private SlotHandle slotHandle;

Expand Down Expand Up @@ -89,7 +93,13 @@ protected String getType( )
*/
public InsertAction( Object selectedObject )
{
this( selectedObject, TEXT );
this( selectedObject,
selectedObject instanceof SlotHandle
&& ( (SlotHandle) selectedObject )
.getSlotID( ) == IModuleModel.PAGE_SLOT
&& ( (SlotHandle) selectedObject )
.getElementHandle( ) instanceof ReportDesignHandle
? NEW_MASTER_PAGE_TEXT : INSERT_TEXT );
}

/**
Expand Down

0 comments on commit 7077fc3

Please sign in to comment.