本文整理汇总了Java中logbook.server.proxy.Filter类的典型用法代码示例。如果您正苦于以下问题:Java Filter类的具体用法?Java Filter怎么用?Java Filter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Filter类属于logbook.server.proxy包,在下文中一共展示了Filter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import logbook.server.proxy.Filter; //导入依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
this.shell = new Shell(this.getParent(), this.getStyle());
this.shell.setText(this.getText());
this.shell.setLayout(new GridLayout(1, false));
// バージョン
Group versionGroup = new Group(this.shell, SWT.NONE);
versionGroup.setText("バージョン");
versionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
versionGroup.setLayout(new GridLayout(2, true));
label(AppConstants.NAME, versionGroup);
label(AppConstants.VERSION.toString(), versionGroup);
Link gowebsite = new Link(versionGroup, SWT.NONE);
gowebsite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL, SWT.CENTER, false, false, 2, 1));
gowebsite.setText("<a>クリックするとウェブサイトに移動します</a>");
gowebsite.addSelectionListener((SelectedListener) e -> {
try {
Desktop.getDesktop().browse(AppConstants.HOME_PAGE_URI);
} catch (Exception ex) {
}
});
// 設定
Group appGroup = new Group(this.shell, SWT.NONE);
appGroup.setText("設定");
appGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
appGroup.setLayout(new GridLayout(2, true));
label("鎮守府サーバー", appGroup);
label(StringUtils.defaultString(Filter.getServerName(), "未設定"), appGroup);
// 設定
Group javaGroup = new Group(this.shell, SWT.NONE);
javaGroup.setText("環境");
javaGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
javaGroup.setLayout(new GridLayout(2, true));
double totalMemory = ((double) Runtime.getRuntime().totalMemory()) / 1024 / 1024;
double freeMemory = ((double) Runtime.getRuntime().freeMemory()) / 1024 / 1024;
label("利用可能メモリサイズ", javaGroup);
label(Long.toString(Math.round(totalMemory)) + " MB", javaGroup);
label("利用中メモリサイズ", javaGroup);
label(Long.toString(Math.round(totalMemory - freeMemory)) + " MB", javaGroup);
label("os.name", javaGroup);
label(SystemUtils.OS_NAME, javaGroup);
label("os.version", javaGroup);
label(SystemUtils.OS_VERSION, javaGroup);
label("java.vendor", javaGroup);
label(SystemUtils.JAVA_VENDOR, javaGroup);
label("java.version", javaGroup);
label(SystemUtils.JAVA_VERSION, javaGroup);
this.shell.pack();
}
示例2: createContents
import logbook.server.proxy.Filter; //导入依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
this.shell = new Shell(this.getParent(), this.getStyle());
this.shell.setText("自動プロキシ構成スクリプトファイル生成");
this.shell.setLayout(new GridLayout(1, false));
Composite composite = new Composite(this.shell, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setLayout(new GridLayout(1, false));
Label labelTitle = new Label(composite, SWT.NONE);
labelTitle.setText("自動プロキシ構成スクリプトファイルを生成します");
String server = Filter.getServerName();
if (server == null) {
Group manualgroup = new Group(composite, SWT.NONE);
manualgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
manualgroup.setLayout(new GridLayout(2, false));
manualgroup.setText("鎮守府サーバーが未検出です。IPアドレスを入力して下さい。");
Label iplabel = new Label(manualgroup, SWT.NONE);
iplabel.setText("IPアドレス:");
final Text text = new Text(manualgroup, SWT.BORDER);
GridData gdip = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdip.widthHint = 150;
text.setLayoutData(gdip);
text.setText("0.0.0.0");
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
CreatePacFileDialog.this.server = text.getText();
}
});
this.server = "0.0.0.0";
} else {
this.server = server;
}
Button storeButton = new Button(composite, SWT.NONE);
storeButton.setText("保存先を選択...");
storeButton.addSelectionListener(new FileSelectionAdapter(this));
Group addrgroup = new Group(composite, SWT.NONE);
addrgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addrgroup.setLayout(new GridLayout(2, false));
addrgroup.setText("アドレス(保存先のアドレスより生成されます)");
Label ieAddrLabel = new Label(addrgroup, SWT.NONE);
ieAddrLabel.setText("IE用:");
this.iePath = new Text(addrgroup, SWT.BORDER);
GridData gdIePath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gdIePath.widthHint = 380;
this.iePath.setLayoutData(gdIePath);
Label fxAddrLabel = new Label(addrgroup, SWT.NONE);
fxAddrLabel.setText("Firefox用:");
this.firefoxPath = new Text(addrgroup, SWT.BORDER);
GridData gdFxPath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gdFxPath.widthHint = 380;
this.firefoxPath.setLayoutData(gdFxPath);
this.shell.pack();
}
示例3: createContents
import logbook.server.proxy.Filter; //导入依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
this.shell = new Shell(this.getParent(), this.getStyle());
this.shell.setText(this.getText());
this.shell.setLayout(new GridLayout(1, false));
// バージョン
Group versionGroup = new Group(this.shell, SWT.NONE);
versionGroup.setText("バージョン");
versionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
versionGroup.setLayout(new GridLayout(2, true));
label("航海日誌 Push通知対応版", versionGroup);
label(AppConstants.VERSION, versionGroup);
Link gowebsite = new Link(versionGroup, SWT.NONE);
gowebsite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL, SWT.CENTER, false, false, 2, 1));
gowebsite.setText("<a>クリックするとウェブサイトに移動します</a>");
gowebsite.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
Desktop.getDesktop().browse(AppConstants.HOME_PAGE_URI);
} catch (Exception e) {
LOG.warn("ウェブサイトに移動が失敗しました", e);
}
}
});
// 設定
Group appGroup = new Group(this.shell, SWT.NONE);
appGroup.setText("設定");
appGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
appGroup.setLayout(new GridLayout(2, true));
label("鎮守府サーバー", appGroup);
label(StringUtils.defaultString(Filter.getServerName(), "未設定"), appGroup);
// 設定
Group javaGroup = new Group(this.shell, SWT.NONE);
javaGroup.setText("環境");
javaGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
javaGroup.setLayout(new GridLayout(2, true));
double totalMemory = ((double) Runtime.getRuntime().totalMemory()) / 1024 / 1024;
double freeMemory = ((double) Runtime.getRuntime().freeMemory()) / 1024 / 1024;
label("利用可能メモリサイズ", javaGroup);
label(Long.toString(Math.round(totalMemory)) + " MB", javaGroup);
label("利用中メモリサイズ", javaGroup);
label(Long.toString(Math.round(totalMemory - freeMemory)) + " MB", javaGroup);
label("os.name", javaGroup);
label(SystemUtils.OS_NAME, javaGroup);
label("os.version", javaGroup);
label(SystemUtils.OS_VERSION, javaGroup);
label("java.vendor", javaGroup);
label(SystemUtils.JAVA_VENDOR, javaGroup);
label("java.version", javaGroup);
label(SystemUtils.JAVA_VERSION, javaGroup);
this.shell.pack();
}
示例4: createContents
import logbook.server.proxy.Filter; //导入依赖的package包/类
/**
* Create contents of the dialog.
*/
private void createContents() {
this.shell = new Shell(this.getParent(), this.getStyle());
this.shell.setText("PAC File Generator");
this.shell.setLayout(new GridLayout(1, false));
Composite composite = new Composite(this.shell, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setLayout(new GridLayout(1, false));
Label labelTitle = new Label(composite, SWT.NONE);
labelTitle.setText("This program is used to generate proxy auto-config (PAC) file which\ncan be utilized by browsers to provide seamless proxy switching.");
String server = Filter.getServerName();
if (server == null) {
Group manualgroup = new Group(composite, SWT.NONE);
manualgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
manualgroup.setLayout(new GridLayout(2, false));
manualgroup.setText("Server IP address not detected");
Label iplabel = new Label(manualgroup, SWT.NONE);
iplabel.setText("IP Address:");
final Text text = new Text(manualgroup, SWT.BORDER);
GridData gdip = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdip.widthHint = 150;
text.setLayoutData(gdip);
text.setText("0.0.0.0");
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
CreatePacFileDialog.this.server = text.getText();
}
});
this.server = "0.0.0.0";
} else {
this.server = server;
}
Button storeButton = new Button(composite, SWT.NONE);
storeButton.setText("Save as...");
storeButton.addSelectionListener(new FileSelectionAdapter(this));
Group addrgroup = new Group(composite, SWT.NONE);
addrgroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addrgroup.setLayout(new GridLayout(2, false));
addrgroup.setText("PAC File Path");
Label ieAddrLabel = new Label(addrgroup, SWT.NONE);
ieAddrLabel.setText("Internet Explorer:");
this.iePath = new Text(addrgroup, SWT.BORDER);
GridData gdIePath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gdIePath.widthHint = 380;
this.iePath.setLayoutData(gdIePath);
Label fxAddrLabel = new Label(addrgroup, SWT.NONE);
fxAddrLabel.setText("Firefox:");
this.firefoxPath = new Text(addrgroup, SWT.BORDER);
GridData gdFxPath = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gdFxPath.widthHint = 380;
this.firefoxPath.setLayoutData(gdFxPath);
this.shell.pack();
}