ï»??xml version="1.0" encoding="utf-8" standalone="yes"?> CellEditor定义了æŸä¸ªåˆ—被编辑时昄¡¤ºçš„外观,它å¯ä»¥æ˜¯æ–‡æœ¬æ¡†ã€ä¸‹æ‹‰åˆ—表框或å•选框åQŒä¹Ÿå¯ä»¥è‡ªå·±å®šä¹‰ã€?/p>
通常使用的CellEditorçš„å¾cÕd°±æ˜¯ï¼šCheckboxCellEditorã€ComboBoxCellEditorå’ŒTextCellEditorã€?br />CellEditor一般用数组æ¥ä¿å˜ï¼Œå¦‚æžœæŸä¸ªåˆ—ä¸éœ€è¦ç¼–辑,则寞®†è¯¥åˆ—çš„CellEditorè®¾äØ“nullã€?br />当CellEditor的数¾l„定义完åŽï¼Œå›_¯åˆ©ç”¨setCellEditors(CellEditor[] editors)æ–ÒŽ³•ž®†è¯¥æ•°ç»„讄¡½®åˆ°å¯¹åº”çš„TreeViewer或TableViewerä¸åŽ»ã€‚ä¾‹å¦‚ï¼š ICellModifierå®šä¹‰äº†ä¸‰ä¸ªæŽ¥å£æ–¹æ³•: public boolean canModify(Object element, String property); public Object getValue(Object element, String property); æ¤å¤„虽然å¯ä»¥˜q”回Object¾cÕdž‹çš„引用,但是使用旉™œ€ž®å¿ƒåQŒç‰¹å®šçš„CellEditor仅接å—特定类型的Value。比如: public void modify(Object element, String property, Object value); GEF¾~–辑器是构架在Draw2Dçš„FigureCanvas上的,而FigureCanvas是swtä¸Canvasçš„å¾c? 当得到FigureCanvas之åŽ,ž®±å¯ä»¥å¾—到GEF¾~–辑器的区域和GEF¾~–辑器内部画布的大å°: ¾~–辑器区域大ž®?FigureCanvas.getBounds(); ç”Õd¸ƒå¤§å°:FigureCanvas.getContents.getBounds(); è‹¥è¦è§¦å‘GEF¾~–è¾‘å™¨çš„æ»šåŠ¨æ¡æ“ä½?仅需调用FigureCanvasçš„scrollToX(int hOffset)å’ŒscrollToY(int vOffset)å›_¯. 获å–FigureCanvas的方法也比较½Ž€å?通过EditPart.getViewer()获得EditPartViewer,一般情况下EditPartViewerçš„Controlž®±æ˜¯FigureCanvas. 列出代ç 如下:
二ã€å®‰è£…顺åºï¼š
Domino Server->Sametime Server->Notes Admin Client->Sametime Client
三ã€Domino Server安装åQ?br />
1.按照æç¤ºå®‰è£…Domino ServeråQŒé€‰æ‹©Domino Enterprise Server
2.˜q行Server Setup Program
3.选择Set up the first server or a new Domino domain.
4.填写Server nameå’ŒServer titleåQŒOrganization Nameå’ŒOrganization Certifier password
5.填写½Ž¡ç†å‘˜çš„å称和密ç ,一定è¦è®°å½•该用户å和密ç ?br />
6.选ä¸Domino Serveræä¾›çš„Http Services
7.ä¸å¿…选ä¸LDAP Service
å››ã€Sametime Server安装åQ?br />
1.按照æç¤ºå®‰è£…Sametime ServeråQŒå¦‚æžœéœ€è¦æ¿€‹z?0端å£åQŒé€‰ä¸Enable HTTP tunnelingã€?br />
2.å¯åЍSametime‹Æ¢è¿Žç•Œé¢åQ?a href="http://domain/stcenter.nsf">http://domain/stcenter.nsfåQŒç™»å½•至½Ž¡ç†™åµé¢åQŒå¦‚æžœæ— æ³•ç™»å½•ï¼Œå¯èƒ½æ˜¯åŸŸåè§£æžé—®é¢˜ï¼Œž®†åŸŸå与ip的对应关¾pÀL·»åŠ åˆ°windows/system32/drivers/etc/hostæ–‡äšgä¸?br />
3.如果‹Æ¢è¿Žç•Œé¢æ²¡æœ‰ç”¨æˆ·æ³¨å†Œé€‰é¡¹åQŒéœ€½Ž¡ç†å‘˜å¼€å¯è¯¥åŠŸèƒ½ã€?br />
在管ç†é¡µé¢ä¸é€‰æ‹©Domino目录->DominoåQŒå‹¾é€?label for="1">å…许用户注册åˆ?Domino 目录一™å¹ï¼Œè¯¥é¡¹éœ€é‡å¯æœåŠ¡å™¨ï¼Œòq¶åœ¨åŽé¢æ“作ä¸ç»™äºˆæƒé™æ”¯æŒã€?br />
五ã€Notes Admin Client安装
1.按照æç¤ºå®‰è£…Notes Admin ClientåQŒå®‰è£…完毕åŽå¯åЍåQŒæ‰“开文äšgTab™åµï¼Œåœ¨Domino Directory上点å‡Õd³é”?>å˜å–控制->½Ž¡ç†åQŒæ‰“å¼€ACL(å˜å–控制列表)å¯¹è¯æ¡?br />
2.æ·ÕdŠ ç”¨æˆ·Sametime Development/Lotus Notes Companion ProductsåQŒåƈ¾l™äºˆä½œè€…æƒé™ï¼Œä½¿å…¶æ‹¥æœ‰åˆ›å¾æ–‡æ¡£½{‰æƒé™ï¼Œç„¶åŽèµ‹äºˆå…¶UserCreator角色åQŒè¯¥æ¥æ“作用以æä¾›ç”¨æˆäh³¨å†Œæ‰€éœ€çš„æƒé™ã€?br />
å…ã€Sametime Client安装
1.按照æç¤ºå®‰è£…Sametime Client
2.˜q›å…¥http://domain/stcenter.nsf注册用户
3.使用该用户和domain地å€ç™Õd½•至sametime
    cellEditors[
0
]Â
=
Â
new
 TextCellEditor(tableViewer.getTable());
    cellEditors[
1
]Â
=
Â
null
;
    cellEditors[
2
]Â
=
Â
new
 ComboBoxCellEditor(tableViewer.getTable(),Â
new
 String[]{
"
first
"
,Â
"
second
"
,Â
"
third
"
,Â
"
forth
"
});
    cellEditors[
3
]Â
=
Â
new
 CheckboxCellEditor(tableViewer.getTable());
    cellEditors[
4
]Â
=
Â
new
 CustomizedTextCellEditor(tableViewer.getTable());
    tableViewer.setCellEditors(cellEditors);
å…¶ä¸CustomizedTextCellEditor是自定义的CellEditoråQŒé¿å…了讄¡½®valueæ—‰™€ æˆçš„空指针异常ã€?br />protected class CustomizedTextCellEditor extends TextCellEditor
{
    public CustomizedTextCellEditor(Composite parent)
{
        super(parent);
    }
    protected void doSetValue(Object value)Â
{
        if(value == null)
            return;
        super.doSetValue(value);
    }       Â
}
CellEditor负责外观åQŒå®ƒå¯¹è¦¾~–辑的模型信æ¯ä¸€æ— 所知。所以jfaceä¸å¼•入了ICellModifier接å£åQŒå°†model与CellEditorè”系在一赗÷€‚äØ“äº†ç¡®å®šåœ¨CellModifierä¸çš„列,需è¦å®šä¹‰columnPropertiesçš„String[]数组åQŒç”¨ä»¥åŒºåˆ†ä¸åŒåˆ—对应的ä¸åŒå±žæ€§ã€‚ä‹É用setColumnProperties(String[] columnProperties)讄¡½®è¯¥å±žæ€§é›†ã€?/p>
该方法判æ–何时该列å¯ä»¥è¢«¾~–辑。其ä¸element是对应的model。返回trueè¡¨ç¤ºæ¤æ—¶è¯¥åˆ—å¯ä»¥è¢«ç¼–辑ã€?/p>
该方法一般在activateCellEditor()时调用,用于讑֮šCellEditorçš„åˆå§‹å€¹{€‚å…¶ä¸element是对应的modelã€?/p>
TextCellEditor对应String¾cÕdž‹çš„ValueåQ?br />ComboBoxCellEditor对应Integer¾cÕdž‹çš„ValueåQ?br />CheckBoxCellEditor对应Boolean¾cÕdž‹çš„ValueåQ?br />若返回了ä¸é€‚åˆçš„Value对象åQŒåˆ™ä¼šæŠ›å‡ºAssertionFailedExceptionã€?/p>
该方法执行ä¿å˜ä¿®æ”V€‚一般在saveEditorValue之类的方法ä¸è°ƒç”¨ã€‚æ¤å¤„çš„elementä¸å†æ˜¯modelåQŒè€Œæ˜¯Item¾cÕdž‹çš„引用。å–用对应的模型åQŒéœ€è¦ä‹Éç”?(Item) element).getData()æ–ÒŽ³•。一般æ¤å¤„çš„valueå€û|¼Œä¹Ÿå°±æ˜¯å½“å‰CellEditorçš„Valueå€û|¼Œä½¿ç”¨CellEditor.getValue()得到。å¦å¤–,在执行完更改åŽï¼Œéœ€è¦åˆ·æ–°å¯¹åº”çš„TableViewer或TreeVieweråQŒä‹Éåšå‡ºçš„æ›´æ–°å¯è§ã€?br />
org.eclipse.debug.internal.ui.elements.adapters.DefaultVariableCellModifier是ICellModifier的一个完整实玎ͼšimport org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.DefaultLabelProvider;
import org.eclipse.debug.internal.ui.VariableValueEditorManager;
import org.eclipse.debug.ui.actions.IVariableValueEditor;
import org.eclipse.jface.viewers.ICellModifier;
/**Â *//**
 * @since 3.2
 *
 */
public class DefaultVariableCellModifier implements ICellModifierÂ
{
   Â
    /**//* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
     */
    public boolean canModify(Object element, String property)Â
{
        if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property))Â
{
            if (element instanceof IVariable)Â
{
                return ((IVariable) element).supportsValueModification();
            }
        }
        return false;
    }
    /**//* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
     */
    public Object getValue(Object element, String property)Â
{
        if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property))Â
{
            if (element instanceof IVariable)Â
{
                IVariable variable = (IVariable) element;
                tryÂ
{
                    return DefaultLabelProvider.escapeSpecialChars(variable.getValue().getValueString());
                } catch (DebugException e)Â
{
                    DebugUIPlugin.log(e);
                }
            }
        }
        return null;
    }
    /**//* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
     */
    public void modify(Object element, String property, Object value)Â
{
        Object oldValue = getValue(element, property);
        if (!value.equals(oldValue))Â
{
            if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property))Â
{
                if (element instanceof IVariable)Â
{
                    IVariable variable = (IVariable) element;
                    IVariableValueEditor editor = VariableValueEditorManager.getDefault().getVariableValueEditor(variable.getModelIdentifier());
                    if (value instanceof String)Â
{
                        value = DefaultLabelProvider.encodeEsacpedChars((String)value);
                    }
                    if (editor != null)Â
{
                        if  (editor.saveVariable(variable, (String) value, DebugUIPlugin.getShell()))Â
{
                            return;
                        }
                    }
                    tryÂ
{
                        variable.setValue((String) value);
                    } catch (DebugException e)Â
{
                        DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), Messages.VariableColumnPresentation_4, Messages.VariableColumnPresentation_5, e.getStatus());
                    }
                }
            }
        }
    }
}
˜q™æ˜¯˜q用了FigureCanvas是Canvaså类的特ç‚?调用SWTçš„Canvasçš„getBounds()æ–ÒŽ³•,匙°ƒç”¨Controlçš„getBounds()æ–ÒŽ³•.
˜q™æ˜¯˜q用了IFigureçš„getBounds()æ–ÒŽ³•, ˜q™ä¸¤ä¸ªåŒºåŸŸçŸ©å½¢ä¸å¯æØœæ·?
canvas.scrollToX(
500
);
canvas.scrollToY(
600
);
System.out.println(canvas.getBounds());
System.out.println(canvas.getContents().getBounds());
(String[])ArrayList.toArray(new String[0]);
JFaceçš„Dialog¾l§æ‰¿äºŽWindow¾c?è¯¥ç±»ä¸æœ‰ä¸€æ–ÒŽ³•,讄¡½®Shellçš„æ ·å¼?
protected void setShellStyle(int newShellStyle)
The shell style bits are used by the framework method createShell
when creating this window's shell.
newShellStyle
- the new shell style bits
在Dialogçš„æž„é€ å‡½æ•îC¸è°ƒç”¨è¯¥æ–¹æ³?å›_¯æ›´æ”¹Dialogçš„æ ·å¼?䏋䨓䏀ä¾?
例如,在Eclipse Editor视图ä¸åŠ å…¥Figure,需è¦è®¡½Ž—出相对于HostFigureçš„åæ ?æ‰èƒ½æ£ç¡®ž®†figure攑֜¨é¼ æ ‡ç‚¹å‡»çš„ä½¾|?å¯ä»¥å¦‚下˜q™æ ·å?
在getCreateCommand(CreateRequest request)æ–ÒŽ³•ä¸?åŠ å…¥å¦‚ä¸‹è¯å¥:
Point location = request.getLocation().getCopy();
getHostFigure().translateToRelative(location);
如æ¤èŽ·å¾—çš„locationž®±æ˜¯ç›¸å¯¹äºŽHostFigureçš„åæ ?
能够获得当å‰å…‰æ ‡¾lå¯¹åæ ‡çš„æ–¹æ³•是:
Display.getDefault().getCursorLocation()
åˆäh–°èµ„æº½Ž¡ç†å™¨è°ƒç”¨æ–¹æ³?
RefreshLocal
public void refreshLocal(int depth, IProgressMonitor monitor)
                 throws CoreException
Refreshes the resource hierarchy from this resource and its children (to the specified depth) relative to the local file system. Creations, deletions, and changes detected in the local file system will be reflected in the workspace's resource tree. This resource need not exist or be local.
This method may discover changes to resources; any such changes will be reported in a subsequent resource change event.
If a new file or directory is discovered in the local file system at or below the location of this resource, any parent folders required to contain the new resource in the workspace will also be created automatically as required.
This method is long-running; progress and cancellation are provided by the given progress monitor.
Parameters:
depth - valid values are DEPTH_ZERO, DEPTH_ONE, or DEPTH_INFINITE
monitor - a progress monitor, or null if progress reporting is not desired
Throws:
CoreException - if this method fails. Reasons include:
Resource changes are disallowed during certain types of resource change event notification. See IResourceChangeEvent for more details.
OperationCanceledException - if the operation is canceled. Cancelation can occur even if no progress monitor is provided.
See Also:
DEPTH_ZERO, DEPTH_ONE, DEPTH_INFINITE, IResourceRuleFactory.refreshRule(IResource)
该方法ä½äºŽorg.eclipse.core.resources.IResource
我的调用æ–ÒŽ³•æ˜?
ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
getAdvanceWidth
         public int getAdvanceWidth(char ch)
The advance width is defined as the horizontal distance the cursor should move after printing the character in the selected font.
å¯ä»¥å¦‚下é¢çš„½E‹åºä½¿ç”¨è¯¥å‡½æ•?