本文整理汇总了Java中logbook.server.proxy.Filter.getServerName方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.getServerName方法的具体用法?Java Filter.getServerName怎么用?Java Filter.getServerName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logbook.server.proxy.Filter
的用法示例。
在下文中一共展示了Filter.getServerName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.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();
}
示例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("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();
}