📄 basicpluginviewmodelimpl.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: BasicPluginViewModelImpl.java
package org.gudy.azureus2.pluginsimpl.local.ui.model;
import java.io.PrintWriter;
import java.io.StringWriter;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.plugins.logging.LoggerChannel;
import org.gudy.azureus2.plugins.logging.LoggerChannelListener;
import org.gudy.azureus2.plugins.ui.components.*;
import org.gudy.azureus2.plugins.ui.model.BasicPluginViewModel;
import org.gudy.azureus2.pluginsimpl.local.ui.UIManagerImpl;
import org.gudy.azureus2.pluginsimpl.local.ui.components.*;
public class BasicPluginViewModelImpl
implements BasicPluginViewModel
{
private UIManagerImpl ui_manager;
private String name;
private UITextField status;
private UITextField activity;
private UITextArea log;
private UIProgressBar progress;
private String sConfigSectionID;
public BasicPluginViewModelImpl(UIManagerImpl _ui_manager, String _name)
{
ui_manager = _ui_manager;
name = _name;
status = new UITextFieldImpl();
activity = new UITextFieldImpl();
log = new UITextAreaImpl();
progress = new UIProgressBarImpl();
}
public String getName()
{
return name;
}
public UITextField getStatus()
{
return status;
}
public UITextField getActivity()
{
return activity;
}
public UITextArea getLogArea()
{
return log;
}
public UIProgressBar getProgress()
{
return progress;
}
public void setConfigSectionID(String id)
{
sConfigSectionID = id;
}
public String getConfigSectionID()
{
return sConfigSectionID;
}
public void destroy()
{
ui_manager.destroy(this);
}
public void attachLoggerChannel(LoggerChannel channel)
{
channel.addListener(new LoggerChannelListener() {
final BasicPluginViewModelImpl this$0;
public void messageLogged(String message, Throwable t)
{
messageLogged(3, message, t);
}
public void messageLogged(int logtype, String message)
{
messageLogged(logtype, message, null);
}
public void messageLogged(int logtype, String message, Throwable t)
{
String log_type_s = null;
switch (logtype)
{
case 2: // '\002'
log_type_s = "warning";
break;
case 3: // '\003'
log_type_s = "error";
break;
}
if (log_type_s != null)
{
String prefix = MessageText.getString((new StringBuilder()).append("AlertMessageBox.").append(log_type_s).toString());
log.appendText((new StringBuilder()).append("[").append(prefix.toUpperCase()).append("] ").toString());
}
log.appendText((new StringBuilder()).append(message).append("\n").toString());
if (t != null)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
log.appendText((new StringBuilder()).append(sw.toString()).append("\n").toString());
}
}
{
this$0 = BasicPluginViewModelImpl.this;
super();
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -