|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
#1
|
|||
|
|||
Protected attributes in BomEditor UI only ...
Hi,
is there a way to protect masterdata attributes in BomEditorUI only - not in AttributeEditor. If i set the tag of this attibute to: <Protect>true</Protect>, it's general protected. The users want to change LinkAttributes in BomEditUI only. I think, there is no way to do it by XML-Settings. Is it posible to do it by Java (extend or replace a class) ??? Which class should be modified? Using MM version 16.00B/C thank you ... |
#2
|
|||
|
|||
Re: Protected attributes in BomEditor UI only ...
Hi,
I just solved my problem, when attribute is using the standard editor class WMAttEditorTextField. Small java extend of this class is requiered (Don't forget to set the editor class of attribute by tag <AttributeEditorClass>): package com.kl_wl_custom.editor; import com.osm.biz.*; import com.osm.datamgmt.ui.WindowManager; import com.osm.editor.WMAttEditor; import com.osm.editor.WMAttEditorTextField; import com.osm.exception.WMException; /** * Class to define a text editfield for an Attribute Editor -- write protected in BomManagerUI ... */ public class CustomAttEditorTextField extends WMAttEditorTextField { private int mode; // *** possible WMAttEditor modes: // INIT_MODE = WMEditor.INIT_MODE = -1; // EDIT_MODE = WMEditor.EDIT_MODE = 0; // VIEW_MODE = WMEditor.VIEW_MODE = 1; // QUERY_MODE = WMEditor.QUERY_MODE = 2; /*----------------------- c o n s t r u c t o r -----------------------*/ public CustomAttEditorTextField(WMAttribute wmAttribute) throws WMException { super(wmAttribute); } public CustomAttEditorTextField(WMAttribute wmAttribute, boolean enabled) throws WMException { super(wmAttribute, enabled); } @Override public void setEnabled(boolean enabled) { if (enabled) { java.awt.Component comp = WindowManager.getInstance().getActiveComponent(); com.osm.datamgmt.ui.EditUI editUI = com.osm.datamgmt.ui.WindowManager.getInstance().getActiveEditUI(); boolean isBomEditorActive = (editUI instanceof com.osm.datamgmt.ui.bom.BOMEditUI && comp instanceof com.osm.datamgmt.ui.bom.BomManagerUI); // in BOMEditUI enabled always false - only in EDIT_MODE ... if (isBomEditorActive && this.mode == WMAttEditor.EDIT_MODE) { enabled = false; } } super.setEnabled(enabled); } @Override public void setMode(int mode) { super.setMode(mode); this.mode = mode; } } |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|