public String getLabel(Object o) { if (o instanceof IServer) return ((IServer) o).getName(); return null; }
/** * @see AbstractTreeLabelProvider#getTextImpl(Object) */ public String getTextImpl(Object element) { IServer server = (IServer) element; return server.getName(); } }
/** * */ public KieServerHandler(IServer server) { super(null,server.getName()); this.server = server; }
public String getColumnText(Object element, int columnIndex) { IServer server2 = (IServer) element; if (columnIndex == 0) return server2.getName(); else if (columnIndex == 0) return "n/a"; return null; }
@Override public String getName() { // TODO Auto-generated method stub return server.getName(); }
/** * Returns the label of an IServer given its id * @param instanceId id of an IServer * @return String label of the IServer with an id equal to instanceId. */ public static String getServerInstanceLabelFromInstanceId( String instanceId ) { IServer server = ServerCore.findServer( instanceId ); return server.getName(); }
public IStatus error(String message, Exception e) { return new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, NLS.bind("{0} [{1}]", message, //$NON-NLS-1$ getServer().getName()), e); }
/** * Get all servers in the workspace * * @return String[] of existing server names */ private String[] getAllExistingServers() { Vector serverIds = new Vector(); { IServer[] servers = ServerCore.getServers(); if (servers != null && servers.length!=0) { for (int i = 0; i < servers.length; i++) { IServer server = (IServer) servers[i]; serverIds.add(server.getName()); existingServersTable_.put(server.getName(), server); } } } return (String[]) serverIds.toArray(new String[serverIds.size()]); }
public Object transform(Object value) { { String serverName = value.toString(); IServer[] servers = ServerCore.getServers(); if (servers != null && servers.length!=0) { for (int i = 0; i < servers.length; i++) { IServer server = (IServer)servers[i]; if ((server.getName()).equals(serverName)) return server; } } } return null; } }
/** * Returns the name of this editor input for display purposes. * <p> * For instance, if the fully qualified input name is * <code>"a\b\MyFile.gif"</code>, the return value would be just * <code>"MyFile.gif"</code>. * * @return the file name string */ public String getName() { if (serverId != null) { IServer server = ServerCore.findServer(serverId); if (server != null) return server.getName(); return serverId; } return ""; }
private IServer getServerFromServerLabel() { if (true) // rsk revisit if (clientIsExistingServer_) { // Maybe this should be in WebServiceServerRuntimeTypeRegistry { IServer[] servers = ServerCore.getServers(); if (servers != null && servers.length!=0) { for (int i = 0; i < servers.length; i++) { IServer server = (IServer) servers[i]; if ((server.getName()).equals(clientServer_)) return server; } } } // } else { //TODO create the server } return null; } /**
/** * @see Object#toString() */ public String toString() { StringBuffer sb = new StringBuffer(); if (server != null) sb.append("Server-Module [" + server.getId() + "/" + server.getName() + ", ("); else sb.append("Server-Module [null, ("); int size = module.length; for (int i = 0; i < size; i++) { if (i > 0) sb.append(", "); sb.append(module[i].getName()); } sb.append(")]"); return sb.toString(); } }
protected String getLaunchLabel() { StringBuilder launchLabel = new StringBuilder(); launchLabel.append(getCloudFoundryServer().getServer().getName()); launchLabel.append(" - "); //$NON-NLS-1$ launchLabel.append(getApplicationModule().getDeployedApplicationName()); return launchLabel.toString(); }
/** * Perform action on this server. * @param server org.eclipse.wst.server.core.IServer */ public void perform(final IServer server) { ServerUIPlugin.addTerminationWatch(shell, server, ServerUIPlugin.STOP); String name = NLS.bind(Messages.dialogStoppingServer, server.getName()); StopServerJob stopJob = new StopServerJob(server, name); stopJob.schedule(); } }
message = NLS.bind(Messages.deleteServerDialogMessage, servers[0].getName()); else message = NLS.bind(Messages.deleteServerDialogMessageMany, servers.length + "");
public String getToolTipText() { String s = null; if (serverId != null) { IServer server = ServerCore.findServer(serverId); if (server != null) { Server server2 = (Server) server; if (server2.getFile() != null) { s = server2.getFile().getFullPath().makeRelative().toString(); if (s.startsWith("/")) s = s.substring(1); } else s = server.getName(); } } if (s == null) s = ""; return s; }
/** * Prompts the user if the server is dirty. Returns true if the server was * not dirty or if the user decided to continue anyway. Returns false if * the server is dirty and the user chose to cancel the operation. * * @param shell a shell * @param server a server * @return boolean */ public static boolean promptIfDirty(Shell shell, IServer server) { if (server == null) return false; if (!(server instanceof IServerWorkingCopy)) return true; String title = Messages.resourceDirtyDialogTitle; IServerWorkingCopy wc = (IServerWorkingCopy) server; if (wc.isDirty()) { String message = NLS.bind(Messages.resourceDirtyDialogMessage, server.getName()); String[] labels = new String[] {Messages.resourceDirtyDialogContinue, IDialogConstants.CANCEL_LABEL}; MessageDialog dialog = new MessageDialog(shell, title, null, message, MessageDialog.INFORMATION, labels, 0); if (dialog.open() != 0) return false; } return true; }
public static void removeServerPreferences(IServer server) { try { String name = getCanonicalName(server.getName()); IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(org.kie.eclipse.Activator.PLUGIN_ID); for (String key : preferences.keys()) { if (key.startsWith(name + IKieConstants.PREF_PATH_SEPARATOR)) { preferences.remove(key); } } preferences.flush(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
protected boolean matchesServer(IServer st) { String text = st.getName(); if (wordMatches(text)) return true; if (st.getServerType() != null && matchesServerType(st.getServerType())) return true; return false; } }
/** * Return the new name to be given to the target resource or * <code>null<code> * if the query was canceled. Rename the currently selected server using the table editor. * Continue the action when the user is done. * * @param server the server to rename */ private void queryNewServerNameInline(final IServer server) { // Make sure text editor is created only once. Simply reset text // editor when action is executed more than once. Fixes bug 22269 if (textEditorParent == null) { createTextEditor(server); } textEditor.setText(server.getName()); // Open text editor with initial size textEditorParent.setVisible(true); Point textSize = textEditor.computeSize(SWT.DEFAULT, SWT.DEFAULT); textSize.x += textSize.y; // Add extra space for new characters Point parentSize = textEditorParent.getSize(); int inset = getCellEditorInset(textEditorParent); textEditor.setBounds(2, inset, Math.min(textSize.x, parentSize.x - 4), parentSize.y - 2 * inset); textEditorParent.redraw(); textEditor.selectAll(); textEditor.setFocus(); }