• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RWT类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.rap.rwt.RWT的典型用法代码示例。如果您正苦于以下问题:Java RWT类的具体用法?Java RWT怎么用?Java RWT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RWT类属于org.eclipse.rap.rwt包,在下文中一共展示了RWT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPartControl

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	Composite composite = new Composite(parent, SWT.None);
	FillLayout layout = new FillLayout();
	layout.type = SWT.VERTICAL;
	composite.setLayout(layout);
	{
		label = new Label(composite, SWT.None);
		setCurrentUser(username);

		logout = new Button(composite, SWT.None);
		logout.setText("Logout");
		logout.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseUp(MouseEvent e) {
				super.mouseUp(e);
				logout();
			}
		});
		logout.setVisible(false);
	}

	callback = new SetCurrentUser();
	UINotifierManager.register(ModelExplorer.EVENT_USER_LOGGED_IN, RWT.getUISession(), callback);
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:27,代码来源:CurrentUserView.java


示例2: setCurrentUser

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
protected void setCurrentUser(Object newUsername) {
	label.getDisplay().asyncExec(new Runnable() {

		@Override
		public void run() {
			if (!newUsername.equals(RWT.getUISession().getHttpSession().getAttribute(ModelExplorer.USERNAME)))
				return;

			username = (String) newUsername;
			label.setText(String.format(CURRENT_USER_FORMAT, username));
			label.update();

			logout.setVisible(true);
		}
	});
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:17,代码来源:CurrentUserView.java


示例3: init

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
@Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
	super.init(site, memento);
	if (memento == null)
		return;
	if (memento.getString(USERNAME) != null && memento.getString(PASSWORD) != null) {
		try {
			RWT.getUISession().getHttpSession().setAttribute(STORAGEACCESS,
					StorageAccessFactory.createStorageAccess(memento.getString(USERNAME),
							memento.getString(PASSWORD), memento.getString(REPOSITORY)));
			RWT.getUISession().getHttpSession().setAttribute(USERNAME, memento.getString(USERNAME));
			RWT.getUISession().getHttpSession().setAttribute(PASSWORD, memento.getString(PASSWORD));
			RWT.getUISession().getHttpSession().setAttribute(REPOSITORY, memento.getString(REPOSITORY));
			processLogin(memento.getString(USERNAME), memento.getString(PASSWORD), memento.getString(REPOSITORY),
					true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:21,代码来源:ModelExplorer.java


示例4: retrieveSavedJars

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public String[] retrieveSavedJars() {
    ApplicationContext context = RWT.getApplicationContext();
    Object loadedJarsObj = context.getAttribute(STAGE_LOADED_JARS_KEY);
    if (loadedJarsObj instanceof String) {
        String loadedJars = (String) loadedJarsObj;
        if (loadedJars.length() > 0) {
            String[] jarSplits = loadedJars.split(JARPATH_SPLITTER);
            // filter out only existing jars
            List<String> existingList = new ArrayList<String>();
            for( String jarPath : jarSplits ) {
                File f = new File(jarPath);
                if (f.exists()) {
                    existingList.add(jarPath);
                }
            }

            if (existingList.size() == 0) {
                return new String[0];
            }

            String[] existingJarsArray = existingList.toArray(new String[existingList.size()]);
            return existingJarsArray;
        }
    }
    return new String[0];
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:27,代码来源:SpatialToolboxSessionPluginSingleton.java


示例5: retrieveSavedHeap

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public int retrieveSavedHeap() throws IOException {
    // return 2000;
    int savedRam = 2000;

    SettingStore settingStore = RWT.getSettingStore();
    Object savedRamObj = settingStore.getAttribute(STAGE_RAM_KEY);
    if (savedRamObj instanceof String) {
        String savedRamStr = (String) savedRamObj;
        try {
            savedRam = Integer.parseInt(savedRamStr);
            if (savedRam <= 0) {
                savedRam = 2000;
                saveHeap(savedRam);
            }
        } catch (NumberFormatException e) {
            // ignore and return default
            saveHeap(savedRam);
        }
    }
    return savedRam;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:22,代码来源:SpatialToolboxSessionPluginSingleton.java


示例6: setImageInBrowser

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
/**
 * Set an image as browser content.
 * 
 * @param browser the browser to use.
 * @param imageId the id of the image to show.
 * @param imageName the name of the image to show.
 * @param dbFile the db to use.
 * @param IMAGE_KEY the image key.
 * @param SERVICE_HANDLER the service handler id.
 * @throws Exception
 */
public static void setImageInBrowser( Browser browser, long imageId, String imageName, File dbFile, String IMAGE_KEY,
        String SERVICE_HANDLER ) throws Exception {
    try (SqliteDb db = new SqliteDb()) {
        db.open(dbFile.getAbsolutePath());
        IJGTConnection connection = db.getConnection();
        byte[] imageData = DaoImages.getImageData(connection, imageId);
        InputStream imageStream = null;
        try {
            imageStream = new ByteArrayInputStream(imageData);
            BufferedImage bufferedImage = createImage(imageStream);
            // store the image in the UISession for the service handler
            RWT.getUISession().setAttribute(IMAGE_KEY, bufferedImage);
            // create the HTML with a single <img> tag.
            browser.setText(createHtml(IMAGE_KEY, SERVICE_HANDLER));
            // newImageFile.delete();
        } catch (Exception e) {
            // File newImageFile = File.createTempFile("stage" + new Date().getTime(),
            // imageName);
            // try (OutputStream outStream = new FileOutputStream(newImageFile)) {
            // outStream.write(imageData);
            // }
            e.printStackTrace();
        }
    }
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:37,代码来源:GeopaparazziUtilities.java


示例7: ensureJavaScriptResources

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static void ensureJavaScriptResources() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();

    for( String[] jsFile : javascriptFiles ) {
        try {
            if (!resourceManager.isRegistered(jsFile[0])) {
                InputStream resourceAsStream = resourceLoader.getResourceAsStream(jsFile[1]);
                if (resourceAsStream == null) {
                    throw new NullPointerException();
                }
                String registered = register(resourceManager, jsFile[0], resourceAsStream);
                if (!toRequireList.contains(registered))
                    toRequireList.add(registered);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
    for( String toRequireStr : toRequireList ) {
        loader.require(toRequireStr);
    }
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:24,代码来源:JsResources.java


示例8: ensureGraphHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureGraphHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "tablesgraph.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequireGraphMap == null)
                toRequireGraphMap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequireGraphMap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequireGraphMap);
    }
    return toRequireGraphMap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例9: ensureQuickmapHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureQuickmapHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "quick_map.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequireQuickMap == null)
                toRequireQuickMap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequireQuickMap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequireQuickMap);
    }
    return toRequireQuickMap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例10: ensureLidarmapHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureLidarmapHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "lidar_map.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequireLidarMap == null)
                toRequireLidarMap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequireLidarMap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequireLidarMap);
    }
    return toRequireLidarMap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例11: ensureThreejsPointsHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureThreejsPointsHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "threejs_points.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequireThreePointsMap == null)
                toRequireThreePointsMap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequireThreePointsMap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequireThreePointsMap);
    }
    return toRequireThreePointsMap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例12: registerIfMissing

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String registerIfMissing( String resource ) {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        // load html
        String location;
        if (!resourceManager.isRegistered(resource)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(resource);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            location = register(resourceManager, resource, resourceAsStream);
        } else {
            location = resourceManager.getLocation(resource);
        }
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(resource);
        return location;
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例13: ensureTreesHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureTreesHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "trees_info.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (!toRequireHtmlList.contains(registered))
                toRequireHtmlList.add(registered);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
    for( String toRequireStr : toRequireHtmlList ) {
        loader.require(toRequireStr);
    }
    return toRequireHtmlList.get(0);
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例14: ensurePlotHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensurePlotHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "plotmap.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequirePlotmap == null)
                toRequirePlotmap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequirePlotmap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequirePlotmap);
    }
    return toRequirePlotmap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例15: ensureChartHtmlResource

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
public static String ensureChartHtmlResource() {
    ResourceManager resourceManager = RWT.getApplicationContext().getResourceManager();
    try {
        String fileName = "profilechart.html";
        if (!resourceManager.isRegistered(fileName)) {
            InputStream resourceAsStream = resourceLoader.getResourceAsStream(fileName);
            if (resourceAsStream == null) {
                throw new NullPointerException();
            }
            String registered = register(resourceManager, fileName, resourceAsStream);
            if (toRequireChartmap == null)
                toRequireChartmap = registered;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (toRequireChartmap != null) {
        JavaScriptLoader loader = RWT.getClient().getService(JavaScriptLoader.class);
        loader.require(toRequireChartmap);
    }
    return toRequireChartmap;
}
 
开发者ID:moovida,项目名称:STAGE,代码行数:23,代码来源:JsResources.java


示例16: attachHistoryListener

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
private void attachHistoryListener() {
	final BrowserNavigation history = RWT.getClient().getService(
		BrowserNavigation.class);
	if (history != null) {
		history.addBrowserNavigationListener(new BrowserNavigationListener() {
			/**
			 *
			 */
			private static final long serialVersionUID = 1L;

			@Override
			public void navigated(BrowserNavigationEvent event) {
				final Examples examples = Examples.getInstance();
				final IExampleContribution contribution = examples
					.getContributionById(event.getState());
				if (contribution != null) {
					selectContribution(contribution);
				}
			}
		});
	}
}
 
开发者ID:amgaera,项目名称:emf-forms-rap-showcase,代码行数:23,代码来源:MainUi.java


示例17: createNavigation

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
private Navigation createNavigation(Composite parent) {
	navBar = new Composite(parent, SWT.NONE);
	navBar.setLayout(new FormLayout());
	navBar.setLayoutData(createNavBarFormData());
	navBar.setData(RWT.CUSTOM_VARIANT, "nav-bar");
	final Navigation navigation = new Navigation(navBar) {

		@Override
		protected void buttonSelected(IExampleContribution contribution) {
			MainUi.this.selectContribution(contribution);
		}
	};
	final Control navigationControl = navigation.getControl();
	navigationControl.setLayoutData(createNavigationFormData());
	navigationControl.setData(RWT.CUSTOM_VARIANT, "navigation");
	return navigation;
}
 
开发者ID:amgaera,项目名称:emf-forms-rap-showcase,代码行数:18,代码来源:MainUi.java


示例18: activate

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
private void activate(IExampleContribution contribution) {
	final IExamplePage examplePage = contribution.createPage();
	if (examplePage != null) {
		final BrowserNavigation history = RWT.getClient().getService(BrowserNavigation.class);
		if (history != null) {
			history.pushState(contribution.getId(), contribution.getId());
		}
		final Control[] children = centerArea.getChildren();
		for (final Control child : children) {
			child.dispose();
		}
		final Composite contentComp = ExampleUtil.initPage(contribution.getTitle(), centerArea);
		examplePage.createControl(contentComp);
		centerArea.layout(true, true);
	}
}
 
开发者ID:amgaera,项目名称:emf-forms-rap-showcase,代码行数:17,代码来源:MainUi.java


示例19: makeLink

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
private static void makeLink(Label control, final String url) {
	control.setCursor(control.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
	control.addMouseListener(new MouseAdapter() {
		/**
		 *
		 */
		private static final long serialVersionUID = 1L;

		@Override
		public void mouseDown(MouseEvent e) {
			final JavaScriptExecutor executor = RWT.getClient().getService(
				JavaScriptExecutor.class);
			if (executor != null) {
				executor.execute("window.location.href = '" + url + "'");
			}
		}
	});
}
 
开发者ID:amgaera,项目名称:emf-forms-rap-showcase,代码行数:19,代码来源:MainUi.java


示例20: configure

import org.eclipse.rap.rwt.RWT; //导入依赖的package包/类
@Override
public void configure(Application application) {
	final Map<String, String> properties = new HashMap<String, String>();
	properties.put(WebClient.PAGE_TITLE, "EMF Forms Showcase"); //$NON-NLS-1$
	properties.put(WebClient.BODY_HTML,
		readTextFromResource("resources/body.html", "UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$
	properties.put(WebClient.FAVICON, "icons/favicon.png"); //$NON-NLS-1$
	application.setOperationMode(OperationMode.SWT_COMPATIBILITY);
	application.addEntryPoint("/", MainUi.class, properties); //$NON-NLS-1$
	application.addStyleSheet(RWT.DEFAULT_THEME_ID, "theme/theme.css"); //$NON-NLS-1$
	application.addResource("icons/favicon.png", //$NON-NLS-1$
		createResourceLoader("icons/favicon.png")); //$NON-NLS-1$
	application.addResource("icons/loading.gif", //$NON-NLS-1$
		createResourceLoader("icons/loading.gif")); //$NON-NLS-1$
	registerClientScriptingResources(application);
}
 
开发者ID:amgaera,项目名称:emf-forms-rap-showcase,代码行数:17,代码来源:ExampleApplication.java



注:本文中的org.eclipse.rap.rwt.RWT类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProtonServer类代码示例发布时间:2022-05-22
下一篇:
Java AbstractLifeCycleListener类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap