@Override public void setText(String text) { Object old = this.text; this.text = text; getEventSupport().firePropertyChange(JRBaseStaticText.PROPERTY_TEXT, old, this.text); }
@Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); NTextPropertyDescriptor textD = new NTextPropertyDescriptor(JRBaseStaticText.PROPERTY_TEXT, Messages.common_text); desc.add(textD); textD.setCategory(Messages.MStaticText_text_description); textD .setHelpRefBuilder(new HelpReferenceBuilder("net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#text")); }
@Override public Object getPropertyValue(Object id) { JRDesignStaticText jrElement = (JRDesignStaticText) getValue(); if (id.equals(JRBaseStaticText.PROPERTY_TEXT)) return jrElement.getText(); return super.getPropertyValue(id); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignStaticText jrElement = (JRDesignStaticText) getValue(); if (id.equals(JRBaseStaticText.PROPERTY_TEXT)){ jrElement.setText((String) value); } else super.setPropertyValue(id, value); }
protected void initCellEditor() { // update text try { MStaticText model = (MStaticText) ((FigureEditPart) getEditPart()).getModel(); getCellEditor().setValue(model.getPropertyValue(JRBaseStaticText.PROPERTY_TEXT)); getCellEditor().getControl().setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); // update font ZoomManager zoomMgr = (ZoomManager) getEditPart().getViewer().getProperty(ZoomManager.class.toString()); if (zoomMgr != null) { // this will force the font to be set cachedZoom = -1.0; updateScaledFont(zoomMgr.getZoom(), model); zoomMgr.addZoomListener(zoomListener); } // else // getCellEditor().getControl().setFont(stickyNote.getFont()); // Hook the cell editor's copy/paste actions to the actionBars so that they can // be invoked via keyboard // shortcuts. actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() .getEditorSite().getActionBars(); saveCurrentActions(actionBars); actionHandler = new CellEditorActionHandler(actionBars); actionHandler.addCellEditor(getCellEditor()); actionBars.updateActionBars(); } catch (Exception ex) { ex.printStackTrace(); } }
@Override protected void initializeProvidedProperties() { super.initializeProvidedProperties(); addProvidedProperties(JRBaseStaticText.PROPERTY_TEXT, Messages.common_text); }
/** * Return the graphical properties for an MStaticText */ public HashSet<String> generateGraphicalProperties(){ HashSet<String> result = super.generateGraphicalProperties(); result.add(JRBaseStaticText.PROPERTY_TEXT); return result; }
@Override public String getName() { return JRBaseStaticText.PROPERTY_TEXT; }
/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parent.setLayout(new GridLayout(2, false)); createWidget4Property(parent, JRBaseStaticText.PROPERTY_TEXT); }