?? actionupdateuserid.java
字號:
package com.zhtelecom.common.topograph.example.menuaction;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import com.zhtelecom.common.topograph.TopoGraphView;
import com.zhtelecom.common.topograph.TopoObject;
import com.zhtelecom.common.topograph.example.NMSExample;
public class ActionUpdateUserID extends AbstractAction
{
public void actionPerformed(ActionEvent e)
{
TopoGraphView topoView = (TopoGraphView) getValue("topoGraphView");
TopoObject topoObject = topoView.getSelectedObject();
String rs = JOptionPane.showInputDialog(topoView, "請輸入新的用戶ID名稱");
if (rs == null || rs.equals(""))
{
rs = "newName" + NMSExample.getNum();
}
StringBuffer userID = (StringBuffer) topoObject.getUserID();
userID.replace(0, userID.length(), rs);
//通知拓撲圖,用戶數據發生改變。
topoObject.fireChanged();
}
public ActionUpdateUserID()
{
super("修改用戶ID對象");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -